1 //===-- DWARFDataExtractor.cpp ----------------------------------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 #include "DWARFDataExtractor.h" 11 12 namespace lldb_private { 13 14 uint64_t 15 DWARFDataExtractor::GetDWARFInitialLength(lldb::offset_t *offset_ptr) const { 16 uint64_t length = GetU32(offset_ptr); 17 m_is_dwarf64 = (length == UINT32_MAX); 18 if (m_is_dwarf64) 19 length = GetU64(offset_ptr); 20 return length; 21 } 22 23 dw_offset_t 24 DWARFDataExtractor::GetDWARFOffset(lldb::offset_t *offset_ptr) const { 25 return GetMaxU64(offset_ptr, m_is_dwarf64 ? 8 : 4); 26 } 27 } 28