1 //===-- DWARFDataExtractor.cpp ----------------------------------*- C++ -*-===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 #include "DWARFDataExtractor.h" 10 11 namespace lldb_private { 12 13 uint64_t 14 DWARFDataExtractor::GetDWARFInitialLength(lldb::offset_t *offset_ptr) const { 15 uint64_t length = GetU32(offset_ptr); 16 m_is_dwarf64 = (length == UINT32_MAX); 17 if (m_is_dwarf64) 18 length = GetU64(offset_ptr); 19 return length; 20 } 21 22 dw_offset_t 23 DWARFDataExtractor::GetDWARFOffset(lldb::offset_t *offset_ptr) const { 24 return GetMaxU64(offset_ptr, GetDWARFSizeOfOffset()); 25 } 26 } 27