tberghammer created this revision. tberghammer added a reviewer: clayborg. tberghammer added a subscriber: lldb-commits.
Add support for the DWARFLocationList used by split-dwarf Split-dwarf uses a different header format to specify the address range for the elements of the location lists. http://reviews.llvm.org/D12880 Files: include/lldb/Expression/DWARFExpression.h lldb.xcodeproj/project.pbxproj source/Expression/DWARFExpression.cpp source/Plugins/SymbolFile/DWARF/CMakeLists.txt source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp source/Plugins/SymbolFile/DWARF/DWARFLocationDescription.cpp source/Plugins/SymbolFile/DWARF/DWARFLocationDescription.h source/Plugins/SymbolFile/DWARF/DWARFLocationList.cpp source/Plugins/SymbolFile/DWARF/DWARFLocationList.h source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h =================================================================== --- source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h +++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h @@ -38,6 +38,9 @@ DWARFCompileUnit* GetDWARFCompileUnit(lldb_private::CompileUnit *comp_unit) override; + lldb_private::DWARFExpression::LocationListFormat + GetLocationListFormat() const override; + protected: DIEToTypePtr& GetDIEToType() override; Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp =================================================================== --- source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp +++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp @@ -10,6 +10,7 @@ #include "SymbolFileDWARFDwo.h" #include "lldb/Core/Section.h" +#include "lldb/Expression/DWARFExpression.h" #include "lldb/Symbol/ObjectFile.h" #include "DWARFCompileUnit.h" @@ -118,3 +119,9 @@ { return m_base_dwarf_cu->GetSymbolFileDWARF(); } + +DWARFExpression::LocationListFormat +SymbolFileDWARFDwo::GetLocationListFormat() const +{ + return DWARFExpression::SplitDwarfLocationList; +} \ No newline at end of file Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h =================================================================== --- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h +++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h @@ -29,6 +29,7 @@ #include "lldb/Core/Flags.h" #include "lldb/Core/RangeMap.h" #include "lldb/Core/UniqueCStringMap.h" +#include "lldb/Expression/DWARFExpression.h" #include "lldb/Symbol/ClangASTContext.h" #include "lldb/Symbol/SymbolFile.h" #include "lldb/Symbol/SymbolContext.h" @@ -316,6 +317,9 @@ virtual lldb::CompUnitSP ParseCompileUnit (DWARFCompileUnit* dwarf_cu, uint32_t cu_idx); + virtual lldb_private::DWARFExpression::LocationListFormat + GetLocationListFormat() const; + protected: typedef llvm::DenseMap<const DWARFDebugInfoEntry *, lldb_private::Type *> DIEToTypePtr; typedef llvm::DenseMap<const DWARFDebugInfoEntry *, lldb::VariableSP> DIEToVariableSP; Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp =================================================================== --- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -70,7 +70,6 @@ #include "DWARFDeclContext.h" #include "DWARFDIECollection.h" #include "DWARFFormValue.h" -#include "DWARFLocationList.h" #include "LogChannelDWARF.h" #include "SymbolFileDWARFDwo.h" #include "SymbolFileDWARFDebugMap.h" @@ -3849,10 +3848,10 @@ } else { - const DWARFDataExtractor& debug_loc_data = get_debug_loc_data(); + const DWARFDataExtractor& debug_loc_data = get_debug_loc_data(); const dw_offset_t debug_loc_offset = form_value.Unsigned(); - size_t loc_list_length = DWARFLocationList::Size(debug_loc_data, debug_loc_offset); + size_t loc_list_length = DWARFExpression::LocationListSize(die.GetCU(), debug_loc_data, debug_loc_offset); if (loc_list_length > 0) { location.CopyOpcodeData(module, debug_loc_data, debug_loc_offset, loc_list_length); @@ -4307,3 +4306,9 @@ } return m_debug_map_symfile; } + +DWARFExpression::LocationListFormat +SymbolFileDWARF::GetLocationListFormat() const +{ + return DWARFExpression::RegularLocationList; +} Index: source/Plugins/SymbolFile/DWARF/DWARFLocationList.h =================================================================== --- source/Plugins/SymbolFile/DWARF/DWARFLocationList.h +++ /dev/null @@ -1,34 +0,0 @@ -//===-- DWARFLocationList.h -------------------------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef SymbolFileDWARF_DWARFLocationList_h_ -#define SymbolFileDWARF_DWARFLocationList_h_ - -#include "SymbolFileDWARF.h" - -class DWARFLocationList -{ -public: - static dw_offset_t - Dump (lldb_private::Stream &s, - const DWARFCompileUnit* cu, - const lldb_private::DWARFDataExtractor& debug_loc_data, - lldb::offset_t offset); - - static bool - Extract (const lldb_private::DWARFDataExtractor& debug_loc_data, - lldb::offset_t* offset_ptr, - lldb_private::DWARFDataExtractor& location_list_data); - - static size_t - Size (const lldb_private::DWARFDataExtractor& debug_loc_data, - lldb::offset_t offset); - -}; -#endif // SymbolFileDWARF_DWARFLocationList_h_ Index: source/Plugins/SymbolFile/DWARF/DWARFLocationList.cpp =================================================================== --- source/Plugins/SymbolFile/DWARF/DWARFLocationList.cpp +++ /dev/null @@ -1,94 +0,0 @@ -//===-- DWARFLocationList.cpp -----------------------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include "DWARFLocationList.h" - -#include "lldb/Core/Stream.h" - -#include "DWARFCompileUnit.h" -#include "DWARFDebugInfo.h" -#include "DWARFLocationDescription.h" - -using namespace lldb_private; - -dw_offset_t -DWARFLocationList::Dump(Stream &s, const DWARFCompileUnit* cu, const DWARFDataExtractor& debug_loc_data, lldb::offset_t offset) -{ - uint64_t start_addr, end_addr; - uint32_t addr_size = DWARFCompileUnit::GetAddressByteSize(cu); - s.SetAddressByteSize(DWARFCompileUnit::GetAddressByteSize(cu)); - dw_addr_t base_addr = cu ? cu->GetBaseAddress() : 0; - while (debug_loc_data.ValidOffset(offset)) - { - start_addr = debug_loc_data.GetMaxU64(&offset,addr_size); - end_addr = debug_loc_data.GetMaxU64(&offset,addr_size); - - if (start_addr == 0 && end_addr == 0) - break; - - s.PutCString("\n "); - s.Indent(); - if (cu) - s.AddressRange (start_addr + base_addr, - end_addr + base_addr, - cu->GetAddressByteSize(), - NULL, - ": "); - uint32_t loc_length = debug_loc_data.GetU16(&offset); - - DWARFDataExtractor locationData(debug_loc_data, offset, loc_length); - // if ( dump_flags & DWARFDebugInfo::eDumpFlag_Verbose ) *ostrm_ptr << " ( "; - print_dwarf_expression (s, locationData, addr_size, 4, false); - offset += loc_length; - } - - return offset; -} - -bool -DWARFLocationList::Extract(const DWARFDataExtractor& debug_loc_data, lldb::offset_t* offset_ptr, DWARFDataExtractor& location_list_data) -{ - // Initialize with no data just in case we don't find anything - location_list_data.Clear(); - - size_t loc_list_length = Size(debug_loc_data, *offset_ptr); - if (loc_list_length > 0) - { - location_list_data.SetData(debug_loc_data, *offset_ptr, loc_list_length); - *offset_ptr += loc_list_length; - return true; - } - - return false; -} - -size_t -DWARFLocationList::Size(const DWARFDataExtractor& debug_loc_data, lldb::offset_t offset) -{ - const dw_offset_t debug_loc_offset = offset; - - while (debug_loc_data.ValidOffset(offset)) - { - dw_addr_t start_addr = debug_loc_data.GetAddress(&offset); - dw_addr_t end_addr = debug_loc_data.GetAddress(&offset); - - if (start_addr == 0 && end_addr == 0) - break; - - uint16_t loc_length = debug_loc_data.GetU16(&offset); - offset += loc_length; - } - - if (offset > debug_loc_offset) - return offset - debug_loc_offset; - return 0; -} - - - Index: source/Plugins/SymbolFile/DWARF/DWARFLocationDescription.h =================================================================== --- source/Plugins/SymbolFile/DWARF/DWARFLocationDescription.h +++ /dev/null @@ -1,24 +0,0 @@ -//===-- DWARFLocationDescription.h ------------------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef SymbolFileDWARF_DWARFLocationDescription_h_ -#define SymbolFileDWARF_DWARFLocationDescription_h_ - -#include "SymbolFileDWARF.h" - -int -print_dwarf_expression (lldb_private::Stream &s, - const lldb_private::DWARFDataExtractor& data, - int address_size, - int dwarf_ref_size, - bool location_expression); - - - -#endif // SymbolFileDWARF_DWARFLocationDescription_h_ Index: source/Plugins/SymbolFile/DWARF/DWARFLocationDescription.cpp =================================================================== --- source/Plugins/SymbolFile/DWARF/DWARFLocationDescription.cpp +++ /dev/null @@ -1,175 +0,0 @@ -//===-- DWARFLocationDescription.cpp ----------------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include "DWARFLocationDescription.h" -#include "DWARFDefines.h" -#include "lldb/lldb-private.h" -#include "lldb/Core/Stream.h" - - -using namespace lldb_private; - -static int print_dwarf_exp_op (Stream &s, const DWARFDataExtractor& data, lldb::offset_t *offset_ptr, int address_size, int dwarf_ref_size); - -int -print_dwarf_expression (Stream &s, - const DWARFDataExtractor& data, - int address_size, - int dwarf_ref_size, - bool location_expression) -{ - int op_count = 0; - lldb::offset_t offset = 0; - while (data.ValidOffset(offset)) - { - if (location_expression && op_count > 0) - { - // err (baton, "Dwarf location expressions may only have one operand!"); - return 1; - } - if (op_count > 0) - { - s.PutCString(", "); - } - if (print_dwarf_exp_op (s, data, &offset, address_size, dwarf_ref_size) == 1) - return 1; - op_count++; - } - - return 0; -} - -static int -print_dwarf_exp_op (Stream &s, - const DWARFDataExtractor& data, - lldb::offset_t *offset_ptr, - int address_size, - int dwarf_ref_size) -{ - uint8_t opcode = data.GetU8(offset_ptr); - DRC_class opcode_class; - uint64_t uint; - int64_t sint; - - int size; - - opcode_class = DW_OP_value_to_class (opcode) & (~DRC_DWARFv3); - - s.Printf("%s ", DW_OP_value_to_name (opcode)); - - /* Does this take zero parameters? If so we can shortcut this function. */ - if (opcode_class == DRC_ZEROOPERANDS) - return 0; - - if (opcode_class == DRC_TWOOPERANDS && opcode == DW_OP_bregx) - { - uint = data.GetULEB128(offset_ptr); - sint = data.GetSLEB128(offset_ptr); - s.Printf("%" PRIu64 " %" PRIi64, uint, sint); - return 0; - } - if (opcode_class != DRC_ONEOPERAND) - { - s.Printf("UNKNOWN OP %u", opcode); - return 1; - } - - switch (opcode) - { - case DW_OP_addr: size = address_size; break; - case DW_OP_const1u: size = 1; break; - case DW_OP_const1s: size = -1; break; - case DW_OP_const2u: size = 2; break; - case DW_OP_const2s: size = -2; break; - case DW_OP_const4u: size = 4; break; - case DW_OP_const4s: size = -4; break; - case DW_OP_const8u: size = 8; break; - case DW_OP_const8s: size = -8; break; - case DW_OP_constu: size = 128; break; - case DW_OP_consts: size = -128; break; - case DW_OP_fbreg: size = -128; break; - case DW_OP_breg0: - case DW_OP_breg1: - case DW_OP_breg2: - case DW_OP_breg3: - case DW_OP_breg4: - case DW_OP_breg5: - case DW_OP_breg6: - case DW_OP_breg7: - case DW_OP_breg8: - case DW_OP_breg9: - case DW_OP_breg10: - case DW_OP_breg11: - case DW_OP_breg12: - case DW_OP_breg13: - case DW_OP_breg14: - case DW_OP_breg15: - case DW_OP_breg16: - case DW_OP_breg17: - case DW_OP_breg18: - case DW_OP_breg19: - case DW_OP_breg20: - case DW_OP_breg21: - case DW_OP_breg22: - case DW_OP_breg23: - case DW_OP_breg24: - case DW_OP_breg25: - case DW_OP_breg26: - case DW_OP_breg27: - case DW_OP_breg28: - case DW_OP_breg29: - case DW_OP_breg30: - case DW_OP_breg31: - size = -128; break; - case DW_OP_pick: - size = 1; break; - case DW_OP_deref_size: - size = 1; break; - case DW_OP_xderef_size: - size = 1; break; - case DW_OP_plus_uconst: - size = 128; break; - case DW_OP_skip: - size = -2; break; - case DW_OP_bra: - size = -2; break; - case DW_OP_call2: - size = 2; break; - case DW_OP_call4: - size = 4; break; - case DW_OP_call_ref: - size = dwarf_ref_size; break; - case DW_OP_piece: - size = 128; break; - case DW_OP_regx: - size = 128; break; - case DW_OP_GNU_addr_index: - case DW_OP_GNU_const_index: - size = 128; break; - default: - s.Printf("UNKNOWN ONE-OPERAND OPCODE, #%u", opcode); - return 1; - } - - switch (size) - { - case -1: sint = (int8_t) data.GetU8(offset_ptr); s.Printf("%+" PRIi64, sint); break; - case -2: sint = (int16_t) data.GetU16(offset_ptr); s.Printf("%+" PRIi64, sint); break; - case -4: sint = (int32_t) data.GetU32(offset_ptr); s.Printf("%+" PRIi64, sint); break; - case -8: sint = (int64_t) data.GetU64(offset_ptr); s.Printf("%+" PRIi64, sint); break; - case -128: sint = data.GetSLEB128(offset_ptr); s.Printf("%+" PRIi64, sint); break; - case 1: uint = data.GetU8(offset_ptr); s.Printf("0x%2.2" PRIx64, uint); break; - case 2: uint = data.GetU16(offset_ptr); s.Printf("0x%4.4" PRIx64, uint); break; - case 4: uint = data.GetU32(offset_ptr); s.Printf("0x%8.8" PRIx64, uint); break; - case 8: uint = data.GetU64(offset_ptr); s.Printf("0x%16.16" PRIx64, uint); break; - case 128: uint = data.GetULEB128(offset_ptr); s.Printf("0x%" PRIx64, uint); break; - } - - return 0; -} Index: source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp =================================================================== --- source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp +++ source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp @@ -25,16 +25,208 @@ #include "DWARFDeclContext.h" #include "DWARFDIECollection.h" #include "DWARFFormValue.h" -#include "DWARFLocationDescription.h" -#include "DWARFLocationList.h" #include "DWARFDebugRanges.h" #include "SymbolFileDWARF.h" #include "SymbolFileDWARFDwo.h" using namespace lldb_private; using namespace std; extern int g_verbose; +static int +print_dwarf_exp_op (Stream &s, + const DWARFDataExtractor& data, + lldb::offset_t *offset_ptr, + int address_size, + int dwarf_ref_size) +{ + uint8_t opcode = data.GetU8(offset_ptr); + DRC_class opcode_class; + uint64_t uint; + int64_t sint; + + int size; + + opcode_class = DW_OP_value_to_class (opcode) & (~DRC_DWARFv3); + + s.Printf("%s ", DW_OP_value_to_name (opcode)); + + /* Does this take zero parameters? If so we can shortcut this function. */ + if (opcode_class == DRC_ZEROOPERANDS) + return 0; + + if (opcode_class == DRC_TWOOPERANDS && opcode == DW_OP_bregx) + { + uint = data.GetULEB128(offset_ptr); + sint = data.GetSLEB128(offset_ptr); + s.Printf("%" PRIu64 " %" PRIi64, uint, sint); + return 0; + } + if (opcode_class != DRC_ONEOPERAND) + { + s.Printf("UNKNOWN OP %u", opcode); + return 1; + } + + switch (opcode) + { + case DW_OP_addr: size = address_size; break; + case DW_OP_const1u: size = 1; break; + case DW_OP_const1s: size = -1; break; + case DW_OP_const2u: size = 2; break; + case DW_OP_const2s: size = -2; break; + case DW_OP_const4u: size = 4; break; + case DW_OP_const4s: size = -4; break; + case DW_OP_const8u: size = 8; break; + case DW_OP_const8s: size = -8; break; + case DW_OP_constu: size = 128; break; + case DW_OP_consts: size = -128; break; + case DW_OP_fbreg: size = -128; break; + case DW_OP_breg0: + case DW_OP_breg1: + case DW_OP_breg2: + case DW_OP_breg3: + case DW_OP_breg4: + case DW_OP_breg5: + case DW_OP_breg6: + case DW_OP_breg7: + case DW_OP_breg8: + case DW_OP_breg9: + case DW_OP_breg10: + case DW_OP_breg11: + case DW_OP_breg12: + case DW_OP_breg13: + case DW_OP_breg14: + case DW_OP_breg15: + case DW_OP_breg16: + case DW_OP_breg17: + case DW_OP_breg18: + case DW_OP_breg19: + case DW_OP_breg20: + case DW_OP_breg21: + case DW_OP_breg22: + case DW_OP_breg23: + case DW_OP_breg24: + case DW_OP_breg25: + case DW_OP_breg26: + case DW_OP_breg27: + case DW_OP_breg28: + case DW_OP_breg29: + case DW_OP_breg30: + case DW_OP_breg31: + size = -128; break; + case DW_OP_pick: + size = 1; break; + case DW_OP_deref_size: + size = 1; break; + case DW_OP_xderef_size: + size = 1; break; + case DW_OP_plus_uconst: + size = 128; break; + case DW_OP_skip: + size = -2; break; + case DW_OP_bra: + size = -2; break; + case DW_OP_call2: + size = 2; break; + case DW_OP_call4: + size = 4; break; + case DW_OP_call_ref: + size = dwarf_ref_size; break; + case DW_OP_piece: + size = 128; break; + case DW_OP_regx: + size = 128; break; + case DW_OP_GNU_addr_index: + case DW_OP_GNU_const_index: + size = 128; break; + default: + s.Printf("UNKNOWN ONE-OPERAND OPCODE, #%u", opcode); + return 1; + } + + switch (size) + { + case -1: sint = (int8_t) data.GetU8(offset_ptr); s.Printf("%+" PRIi64, sint); break; + case -2: sint = (int16_t) data.GetU16(offset_ptr); s.Printf("%+" PRIi64, sint); break; + case -4: sint = (int32_t) data.GetU32(offset_ptr); s.Printf("%+" PRIi64, sint); break; + case -8: sint = (int64_t) data.GetU64(offset_ptr); s.Printf("%+" PRIi64, sint); break; + case -128: sint = data.GetSLEB128(offset_ptr); s.Printf("%+" PRIi64, sint); break; + case 1: uint = data.GetU8(offset_ptr); s.Printf("0x%2.2" PRIx64, uint); break; + case 2: uint = data.GetU16(offset_ptr); s.Printf("0x%4.4" PRIx64, uint); break; + case 4: uint = data.GetU32(offset_ptr); s.Printf("0x%8.8" PRIx64, uint); break; + case 8: uint = data.GetU64(offset_ptr); s.Printf("0x%16.16" PRIx64, uint); break; + case 128: uint = data.GetULEB128(offset_ptr); s.Printf("0x%" PRIx64, uint); break; + } + + return 0; +} + +static int +print_dwarf_expression (Stream &s, + const DWARFDataExtractor& data, + int address_size, + int dwarf_ref_size, + bool location_expression) +{ + int op_count = 0; + lldb::offset_t offset = 0; + while (data.ValidOffset(offset)) + { + if (location_expression && op_count > 0) + { + // err (baton, "Dwarf location expressions may only have one operand!"); + return 1; + } + if (op_count > 0) + { + s.PutCString(", "); + } + if (print_dwarf_exp_op (s, data, &offset, address_size, dwarf_ref_size) == 1) + return 1; + op_count++; + } + + return 0; +} + +static dw_offset_t +print_dwarf_location_list(Stream &s, + const DWARFCompileUnit* cu, + const DWARFDataExtractor& debug_loc_data, + lldb::offset_t offset) +{ + uint64_t start_addr, end_addr; + uint32_t addr_size = DWARFCompileUnit::GetAddressByteSize(cu); + s.SetAddressByteSize(DWARFCompileUnit::GetAddressByteSize(cu)); + dw_addr_t base_addr = cu ? cu->GetBaseAddress() : 0; + while (debug_loc_data.ValidOffset(offset)) + { + start_addr = debug_loc_data.GetMaxU64(&offset,addr_size); + end_addr = debug_loc_data.GetMaxU64(&offset,addr_size); + + if (start_addr == 0 && end_addr == 0) + break; + + s.PutCString("\n "); + s.Indent(); + if (cu) + s.AddressRange (start_addr + base_addr, + end_addr + base_addr, + cu->GetAddressByteSize(), + NULL, + ": "); + uint32_t loc_length = debug_loc_data.GetU16(&offset); + + DWARFDataExtractor locationData(debug_loc_data, offset, loc_length); + // if ( dump_flags & DWARFDebugInfo::eDumpFlag_Verbose ) *ostrm_ptr << " ( "; + print_dwarf_expression (s, locationData, addr_size, 4, false); + offset += loc_length; + } + + return offset; +} + bool DWARFDebugInfoEntry::FastExtract ( @@ -555,7 +747,7 @@ const DWARFDataExtractor &debug_loc_data = dwarf2Data->get_debug_loc_data(); const dw_offset_t debug_loc_offset = form_value.Unsigned(); - size_t loc_list_length = DWARFLocationList::Size(debug_loc_data, debug_loc_offset); + size_t loc_list_length = DWARFExpression::LocationListSize(cu, debug_loc_data, debug_loc_offset); if (loc_list_length > 0) { frame_base->SetOpcodeData(module, debug_loc_data, debug_loc_offset, loc_list_length); @@ -814,7 +1006,7 @@ { if ( !verbose ) form_value.Dump(s); - DWARFLocationList::Dump(s, cu, dwarf2Data->get_debug_loc_data(), debug_loc_offset); + print_dwarf_location_list(s, cu, dwarf2Data->get_debug_loc_data(), debug_loc_offset); } else { Index: source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp =================================================================== --- source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp +++ source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp @@ -18,8 +18,6 @@ #include "DWARFDeclContext.h" #include "DWARFDIECollection.h" #include "DWARFFormValue.h" -#include "DWARFLocationDescription.h" -#include "DWARFLocationList.h" #include "SymbolFileDWARF.h" #include "lldb/Core/Module.h" Index: source/Plugins/SymbolFile/DWARF/CMakeLists.txt =================================================================== --- source/Plugins/SymbolFile/DWARF/CMakeLists.txt +++ source/Plugins/SymbolFile/DWARF/CMakeLists.txt @@ -22,8 +22,6 @@ DWARFDIE.cpp DWARFDIECollection.cpp DWARFFormValue.cpp - DWARFLocationDescription.cpp - DWARFLocationList.cpp HashedNameToDIE.cpp LogChannelDWARF.cpp NameToDIE.cpp Index: source/Expression/DWARFExpression.cpp =================================================================== --- source/Expression/DWARFExpression.cpp +++ source/Expression/DWARFExpression.cpp @@ -43,6 +43,15 @@ using namespace lldb; using namespace lldb_private; +static lldb::addr_t +ReadAddressFromDebugAddrSection(const DWARFCompileUnit* dwarf_cu, uint32_t index) +{ + uint32_t index_size = dwarf_cu->GetAddressByteSize(); + dw_offset_t addr_base = dwarf_cu->GetAddrBase(); + lldb::offset_t offset = addr_base + index * index_size; + return dwarf_cu->GetSymbolFileDWARF()->get_debug_addr_data().GetMaxU64(&offset, index_size); +} + // TODO- why is this also defined (in a better way) in DWARFDefines.cpp? const char * DW_OP_value_to_name (uint32_t val) @@ -726,8 +735,14 @@ addr_t curr_base_addr = location_list_base_addr; while (m_data.ValidOffset(offset)) { - lldb::addr_t begin_addr_offset = m_data.GetAddress(&offset); - lldb::addr_t end_addr_offset = m_data.GetAddress(&offset); + addr_t begin_addr_offset = LLDB_INVALID_ADDRESS; + addr_t end_addr_offset = LLDB_INVALID_ADDRESS; + if (!AddressRangeForLocationListEntry(m_dwarf_cu, m_data, &offset, begin_addr_offset, end_addr_offset)) + break; + + if (begin_addr_offset == 0 && end_addr_offset == 0) + break; + if (begin_addr_offset < end_addr_offset) { if (count > 0) @@ -740,11 +755,6 @@ s->PutChar('}'); offset += location_length; } - else if (begin_addr_offset == 0 && end_addr_offset == 0) - { - // The end of the location list is marked by both the start and end offset being zero - break; - } else { if ((m_data.GetAddressByteSize() == 4 && (begin_addr_offset == UINT32_MAX)) || @@ -1070,8 +1080,7 @@ } lldb::addr_t -DWARFExpression::GetLocation_DW_OP_addr (uint32_t op_addr_idx, - bool &error) const +DWARFExpression::GetLocation_DW_OP_addr (uint32_t op_addr_idx, bool &error) const { error = false; if (IsLocationList()) @@ -1101,10 +1110,7 @@ break; } - uint32_t index_size = m_dwarf_cu->GetAddressByteSize(); - dw_offset_t addr_base = m_dwarf_cu->GetAddrBase(); - lldb::offset_t offset = addr_base + index * index_size; - return m_dwarf_cu->GetSymbolFileDWARF()->get_debug_addr_data().GetMaxU64(&offset, index_size); + return ReadAddressFromDebugAddrSection(m_dwarf_cu, index); } else ++curr_op_addr_idx; @@ -1189,20 +1195,21 @@ while (m_data.ValidOffset(offset)) { // We need to figure out what the value is for the location. - addr_t lo_pc = m_data.GetAddress(&offset); - addr_t hi_pc = m_data.GetAddress(&offset); + addr_t lo_pc = LLDB_INVALID_ADDRESS; + addr_t hi_pc = LLDB_INVALID_ADDRESS; + if (!AddressRangeForLocationListEntry(m_dwarf_cu, m_data, &offset, lo_pc, hi_pc)) + break; + if (lo_pc == 0 && hi_pc == 0) break; - else - { - lo_pc += loclist_base_addr - m_loclist_slide; - hi_pc += loclist_base_addr - m_loclist_slide; - if (lo_pc <= addr && addr < hi_pc) - return true; + lo_pc += loclist_base_addr - m_loclist_slide; + hi_pc += loclist_base_addr - m_loclist_slide; - offset += m_data.GetU16(&offset); - } + if (lo_pc <= addr && addr < hi_pc) + return true; + + offset += m_data.GetU16(&offset); } } return false; @@ -1225,24 +1232,23 @@ while (m_data.ValidOffset(offset)) { // We need to figure out what the value is for the location. - addr_t lo_pc = m_data.GetAddress(&offset); - addr_t hi_pc = m_data.GetAddress(&offset); + addr_t lo_pc = LLDB_INVALID_ADDRESS; + addr_t hi_pc = LLDB_INVALID_ADDRESS; + if (!AddressRangeForLocationListEntry(m_dwarf_cu, m_data, &offset, lo_pc, hi_pc)) + break; + if (lo_pc == 0 && hi_pc == 0) - { break; - } - else - { - lo_pc += curr_base_addr - m_loclist_slide; - hi_pc += curr_base_addr - m_loclist_slide; - - length = m_data.GetU16(&offset); - - if (length > 0 && lo_pc <= pc && pc < hi_pc) - return true; - offset += length; - } + lo_pc += curr_base_addr - m_loclist_slide; + hi_pc += curr_base_addr - m_loclist_slide; + + length = m_data.GetU16(&offset); + + if (length > 0 && lo_pc <= pc && pc < hi_pc) + return true; + + offset += length; } } offset = LLDB_INVALID_OFFSET; @@ -1334,37 +1340,36 @@ while (m_data.ValidOffset(offset)) { // We need to figure out what the value is for the location. - addr_t lo_pc = m_data.GetAddress(&offset); - addr_t hi_pc = m_data.GetAddress(&offset); + addr_t lo_pc = LLDB_INVALID_ADDRESS; + addr_t hi_pc = LLDB_INVALID_ADDRESS; + if (!AddressRangeForLocationListEntry(m_dwarf_cu, m_data, &offset, lo_pc, hi_pc)) + break; + if (lo_pc == 0 && hi_pc == 0) - { break; - } - else - { - lo_pc += curr_loclist_base_load_addr - m_loclist_slide; - hi_pc += curr_loclist_base_load_addr - m_loclist_slide; - uint16_t length = m_data.GetU16(&offset); + lo_pc += curr_loclist_base_load_addr - m_loclist_slide; + hi_pc += curr_loclist_base_load_addr - m_loclist_slide; - if (length > 0 && lo_pc <= pc && pc < hi_pc) - { - return DWARFExpression::Evaluate (exe_ctx, - expr_locals, - decl_map, - reg_ctx, - module_sp, - m_data, - m_dwarf_cu, - offset, - length, - m_reg_kind, - initial_value_ptr, - result, - error_ptr); - } - offset += length; + uint16_t length = m_data.GetU16(&offset); + + if (length > 0 && lo_pc <= pc && pc < hi_pc) + { + return DWARFExpression::Evaluate (exe_ctx, + expr_locals, + decl_map, + reg_ctx, + module_sp, + m_data, + m_dwarf_cu, + offset, + length, + m_reg_kind, + initial_value_ptr, + result, + error_ptr); } + offset += length; } } if (error_ptr) @@ -3117,3 +3122,74 @@ return true; // Return true on success } +size_t +DWARFExpression::LocationListSize(const DWARFCompileUnit* dwarf_cu, + const DataExtractor& debug_loc_data, + lldb::offset_t offset) +{ + const lldb::offset_t debug_loc_offset = offset; + while (debug_loc_data.ValidOffset(offset)) + { + lldb::addr_t start_addr = LLDB_INVALID_ADDRESS; + lldb::addr_t end_addr = LLDB_INVALID_ADDRESS; + if (!AddressRangeForLocationListEntry(dwarf_cu, debug_loc_data, &offset, start_addr, end_addr)) + break; + + if (start_addr == 0 && end_addr == 0) + break; + + uint16_t loc_length = debug_loc_data.GetU16(&offset); + offset += loc_length; + } + + if (offset > debug_loc_offset) + return offset - debug_loc_offset; + return 0; +} + +bool +DWARFExpression::AddressRangeForLocationListEntry(const DWARFCompileUnit* dwarf_cu, + const DataExtractor& debug_loc_data, + lldb::offset_t* offset_ptr, + lldb::addr_t& low_pc, + lldb::addr_t& high_pc) +{ + if (!debug_loc_data.ValidOffset(*offset_ptr)) + return false; + + switch (dwarf_cu->GetSymbolFileDWARF()->GetLocationListFormat()) + { + case NonLocationList: + return false; + case RegularLocationList: + low_pc = debug_loc_data.GetAddress(offset_ptr); + high_pc = debug_loc_data.GetAddress(offset_ptr); + return true; + case SplitDwarfLocationList: + switch (debug_loc_data.GetU8(offset_ptr)) + { + case DW_LLE_end_of_list_entry: + return false; + case DW_LLE_start_end_entry: + { + uint64_t index = debug_loc_data.GetULEB128(offset_ptr); + low_pc = ReadAddressFromDebugAddrSection(dwarf_cu, index); + index = debug_loc_data.GetULEB128(offset_ptr); + high_pc = ReadAddressFromDebugAddrSection(dwarf_cu, index); + return true; + } + case DW_LLE_start_length_entry: + { + uint64_t index = debug_loc_data.GetULEB128(offset_ptr); + low_pc = ReadAddressFromDebugAddrSection(dwarf_cu, index); + uint32_t length = debug_loc_data.GetU32(offset_ptr); + high_pc = low_pc + length; + return true; + } + default: + // Not supported entry type + return false; + } + return true; + } +} Index: lldb.xcodeproj/project.pbxproj =================================================================== --- lldb.xcodeproj/project.pbxproj +++ lldb.xcodeproj/project.pbxproj @@ -459,8 +459,6 @@ 268900C413353E5F00698AC0 /* DWARFDefines.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89CF10F57C5600BB2B04 /* DWARFDefines.cpp */; }; 268900C513353E5F00698AC0 /* DWARFDIECollection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89D110F57C5600BB2B04 /* DWARFDIECollection.cpp */; }; 268900C613353E5F00698AC0 /* DWARFFormValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89D310F57C5600BB2B04 /* DWARFFormValue.cpp */; }; - 268900C713353E5F00698AC0 /* DWARFLocationDescription.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89D510F57C5600BB2B04 /* DWARFLocationDescription.cpp */; }; - 268900C813353E5F00698AC0 /* DWARFLocationList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89D710F57C5600BB2B04 /* DWARFLocationList.cpp */; }; 268900C913353E5F00698AC0 /* NameToDIE.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2618D9EA12406FE600F2B8FE /* NameToDIE.cpp */; }; 268900CA13353E5F00698AC0 /* SymbolFileDWARF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89D910F57C5600BB2B04 /* SymbolFileDWARF.cpp */; }; 268900CB13353E5F00698AC0 /* LogChannelDWARF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26109B3B1155D70100CC3529 /* LogChannelDWARF.cpp */; }; @@ -739,15 +737,15 @@ 9443B123140C26AB0013457C /* SBData.h in Headers */ = {isa = PBXBuildFile; fileRef = 9443B120140C18A90013457C /* SBData.h */; settings = {ATTRIBUTES = (Public, ); }; }; 945215DF17F639EE00521C0B /* ValueObjectPrinter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 945215DE17F639EE00521C0B /* ValueObjectPrinter.cpp */; }; 9452573A16262D0200325455 /* SBDeclaration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9452573916262D0200325455 /* SBDeclaration.cpp */; }; - 945261BF1B9A11FC00BF138D /* CxxStringTypes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 945261B31B9A11E800BF138D /* CxxStringTypes.cpp */; settings = {ASSET_TAGS = (); }; }; - 945261C01B9A11FC00BF138D /* LibCxx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 945261B51B9A11E800BF138D /* LibCxx.cpp */; settings = {ASSET_TAGS = (); }; }; - 945261C11B9A11FC00BF138D /* LibCxxInitializerList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 945261B71B9A11E800BF138D /* LibCxxInitializerList.cpp */; settings = {ASSET_TAGS = (); }; }; - 945261C21B9A11FC00BF138D /* LibCxxList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 945261B81B9A11E800BF138D /* LibCxxList.cpp */; settings = {ASSET_TAGS = (); }; }; - 945261C31B9A11FC00BF138D /* LibCxxMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 945261B91B9A11E800BF138D /* LibCxxMap.cpp */; settings = {ASSET_TAGS = (); }; }; - 945261C41B9A11FC00BF138D /* LibCxxUnorderedMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 945261BA1B9A11E800BF138D /* LibCxxUnorderedMap.cpp */; settings = {ASSET_TAGS = (); }; }; - 945261C51B9A11FC00BF138D /* LibCxxVector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 945261BB1B9A11E800BF138D /* LibCxxVector.cpp */; settings = {ASSET_TAGS = (); }; }; - 945261C61B9A11FC00BF138D /* LibStdcpp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 945261BC1B9A11E800BF138D /* LibStdcpp.cpp */; settings = {ASSET_TAGS = (); }; }; - 945261C81B9A14D300BF138D /* CXXFunctionPointer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 945261C71B9A14D300BF138D /* CXXFunctionPointer.cpp */; settings = {ASSET_TAGS = (); }; }; + 945261BF1B9A11FC00BF138D /* CxxStringTypes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 945261B31B9A11E800BF138D /* CxxStringTypes.cpp */; }; + 945261C01B9A11FC00BF138D /* LibCxx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 945261B51B9A11E800BF138D /* LibCxx.cpp */; }; + 945261C11B9A11FC00BF138D /* LibCxxInitializerList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 945261B71B9A11E800BF138D /* LibCxxInitializerList.cpp */; }; + 945261C21B9A11FC00BF138D /* LibCxxList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 945261B81B9A11E800BF138D /* LibCxxList.cpp */; }; + 945261C31B9A11FC00BF138D /* LibCxxMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 945261B91B9A11E800BF138D /* LibCxxMap.cpp */; }; + 945261C41B9A11FC00BF138D /* LibCxxUnorderedMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 945261BA1B9A11E800BF138D /* LibCxxUnorderedMap.cpp */; }; + 945261C51B9A11FC00BF138D /* LibCxxVector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 945261BB1B9A11E800BF138D /* LibCxxVector.cpp */; }; + 945261C61B9A11FC00BF138D /* LibStdcpp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 945261BC1B9A11E800BF138D /* LibStdcpp.cpp */; }; + 945261C81B9A14D300BF138D /* CXXFunctionPointer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 945261C71B9A14D300BF138D /* CXXFunctionPointer.cpp */; }; 945759671534941F005A9070 /* PlatformPOSIX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 945759651534941F005A9070 /* PlatformPOSIX.cpp */; }; 945E8D80152F6AB40019BCCD /* StreamGDBRemote.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 945E8D7F152F6AB40019BCCD /* StreamGDBRemote.cpp */; }; 9461569A14E358A6003A195C /* SBTypeFilter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9461568A14E35621003A195C /* SBTypeFilter.cpp */; }; @@ -762,13 +760,13 @@ 9475C18F14E5F858001BFC6D /* SBTypeNameSpecifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 9475C18C14E5F826001BFC6D /* SBTypeNameSpecifier.h */; settings = {ATTRIBUTES = (Public, ); }; }; 947A1D641616476B0017C8D1 /* CommandObjectPlugin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 947A1D621616476A0017C8D1 /* CommandObjectPlugin.cpp */; }; 949ADF031406F648004833E1 /* ValueObjectConstResultImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 949ADF021406F648004833E1 /* ValueObjectConstResultImpl.cpp */; }; - 949EEDA01BA74B6D008C63CF /* CoreMedia.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 949EED9E1BA74B64008C63CF /* CoreMedia.cpp */; settings = {ASSET_TAGS = (); }; }; - 949EEDA31BA76577008C63CF /* Cocoa.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 949EEDA11BA76571008C63CF /* Cocoa.cpp */; settings = {ASSET_TAGS = (); }; }; - 949EEDAE1BA7671C008C63CF /* CF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 949EEDAC1BA76719008C63CF /* CF.cpp */; settings = {ASSET_TAGS = (); }; }; - 949EEDAF1BA76729008C63CF /* NSArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 949EEDA41BA765B5008C63CF /* NSArray.cpp */; settings = {ASSET_TAGS = (); }; }; - 949EEDB11BA7672D008C63CF /* NSDictionary.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 949EEDA51BA765B5008C63CF /* NSDictionary.cpp */; settings = {ASSET_TAGS = (); }; }; - 949EEDB21BA76731008C63CF /* NSIndexPath.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 949EEDA61BA765B5008C63CF /* NSIndexPath.cpp */; settings = {ASSET_TAGS = (); }; }; - 949EEDB31BA76736008C63CF /* NSSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 949EEDA71BA765B5008C63CF /* NSSet.cpp */; settings = {ASSET_TAGS = (); }; }; + 949EEDA01BA74B6D008C63CF /* CoreMedia.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 949EED9E1BA74B64008C63CF /* CoreMedia.cpp */; }; + 949EEDA31BA76577008C63CF /* Cocoa.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 949EEDA11BA76571008C63CF /* Cocoa.cpp */; }; + 949EEDAE1BA7671C008C63CF /* CF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 949EEDAC1BA76719008C63CF /* CF.cpp */; }; + 949EEDAF1BA76729008C63CF /* NSArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 949EEDA41BA765B5008C63CF /* NSArray.cpp */; }; + 949EEDB11BA7672D008C63CF /* NSDictionary.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 949EEDA51BA765B5008C63CF /* NSDictionary.cpp */; }; + 949EEDB21BA76731008C63CF /* NSIndexPath.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 949EEDA61BA765B5008C63CF /* NSIndexPath.cpp */; }; + 949EEDB31BA76736008C63CF /* NSSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 949EEDA71BA765B5008C63CF /* NSSet.cpp */; }; 94A5B3971AB9FE8D00A5EE7F /* EmulateInstructionMIPS64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94A5B3951AB9FE8300A5EE7F /* EmulateInstructionMIPS64.cpp */; }; 94B638531B8F8E6C004FE1E4 /* Language.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94B638521B8F8E6C004FE1E4 /* Language.cpp */; }; 94B6385D1B8FB178004FE1E4 /* CPlusPlusLanguage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94B6385B1B8FB174004FE1E4 /* CPlusPlusLanguage.cpp */; }; @@ -1259,10 +1257,6 @@ 260C89D210F57C5600BB2B04 /* DWARFDIECollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWARFDIECollection.h; sourceTree = "<group>"; }; 260C89D310F57C5600BB2B04 /* DWARFFormValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DWARFFormValue.cpp; sourceTree = "<group>"; }; 260C89D410F57C5600BB2B04 /* DWARFFormValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWARFFormValue.h; sourceTree = "<group>"; }; - 260C89D510F57C5600BB2B04 /* DWARFLocationDescription.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DWARFLocationDescription.cpp; sourceTree = "<group>"; }; - 260C89D610F57C5600BB2B04 /* DWARFLocationDescription.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWARFLocationDescription.h; sourceTree = "<group>"; }; - 260C89D710F57C5600BB2B04 /* DWARFLocationList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DWARFLocationList.cpp; sourceTree = "<group>"; }; - 260C89D810F57C5600BB2B04 /* DWARFLocationList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWARFLocationList.h; sourceTree = "<group>"; }; 260C89D910F57C5600BB2B04 /* SymbolFileDWARF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SymbolFileDWARF.cpp; sourceTree = "<group>"; }; 260C89DA10F57C5600BB2B04 /* SymbolFileDWARF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SymbolFileDWARF.h; sourceTree = "<group>"; }; 260C89DB10F57C5600BB2B04 /* SymbolFileDWARFDebugMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SymbolFileDWARFDebugMap.cpp; sourceTree = "<group>"; }; @@ -3170,10 +3164,6 @@ 260C89D210F57C5600BB2B04 /* DWARFDIECollection.h */, 260C89D310F57C5600BB2B04 /* DWARFFormValue.cpp */, 260C89D410F57C5600BB2B04 /* DWARFFormValue.h */, - 260C89D510F57C5600BB2B04 /* DWARFLocationDescription.cpp */, - 260C89D610F57C5600BB2B04 /* DWARFLocationDescription.h */, - 260C89D710F57C5600BB2B04 /* DWARFLocationList.cpp */, - 260C89D810F57C5600BB2B04 /* DWARFLocationList.h */, 26A0DA4D140F721D006DA411 /* HashedNameToDIE.h */, 26109B3B1155D70100CC3529 /* LogChannelDWARF.cpp */, 26109B3C1155D70100CC3529 /* LogChannelDWARF.h */, @@ -6393,9 +6383,7 @@ 3FDFE53119A292F0009756A7 /* HostInfoPosix.cpp in Sources */, 233B007D1960C9F90090E598 /* ProcessInfo.cpp in Sources */, 3FDFE52C19A2917A009756A7 /* HostInfoMacOSX.mm in Sources */, - 268900C713353E5F00698AC0 /* DWARFLocationDescription.cpp in Sources */, 26BC17B118C7F4CB00D2196D /* ThreadElfCore.cpp in Sources */, - 268900C813353E5F00698AC0 /* DWARFLocationList.cpp in Sources */, 268900C913353E5F00698AC0 /* NameToDIE.cpp in Sources */, 268900CA13353E5F00698AC0 /* SymbolFileDWARF.cpp in Sources */, 268900CB13353E5F00698AC0 /* LogChannelDWARF.cpp in Sources */, Index: include/lldb/Expression/DWARFExpression.h =================================================================== --- include/lldb/Expression/DWARFExpression.h +++ include/lldb/Expression/DWARFExpression.h @@ -42,6 +42,13 @@ class DWARFExpression { public: + enum LocationListFormat : uint8_t + { + NonLocationList, // Not a location list + RegularLocationList, // Location list format used in non-split dwarf files + SplitDwarfLocationList, // Location list format used in split dwarf files + }; + //------------------------------------------------------------------ /// Constructor //------------------------------------------------------------------ @@ -401,6 +408,11 @@ lldb::addr_t address, ABI *abi); + static size_t + LocationListSize(const DWARFCompileUnit* dwarf_cu, + const DataExtractor& debug_loc_data, + lldb::offset_t offset); + protected: //------------------------------------------------------------------ /// Pretty-prints the location expression to a stream @@ -434,6 +446,13 @@ lldb::offset_t &offset, lldb::offset_t &len); + static bool + AddressRangeForLocationListEntry(const DWARFCompileUnit* dwarf_cu, + const DataExtractor& debug_loc_data, + lldb::offset_t* offset_ptr, + lldb::addr_t& low_pc, + lldb::addr_t& high_pc); + //------------------------------------------------------------------ /// Classes that inherit from DWARFExpression can see and modify these //------------------------------------------------------------------ @@ -447,7 +466,6 @@ lldb::addr_t m_loclist_slide; ///< A value used to slide the location list offsets so that ///< they are relative to the object that owns the location list ///< (the function for frame base and variable location lists) - }; } // namespace lldb_private
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits