Index: lldb/trunk/include/lldb/Expression/DWARFExpression.h =================================================================== --- lldb/trunk/include/lldb/Expression/DWARFExpression.h +++ lldb/trunk/include/lldb/Expression/DWARFExpression.h @@ -18,7 +18,7 @@ #include "lldb/lldb-private.h" #include -class DWARFCompileUnit; +class DWARFUnit; namespace lldb_private { @@ -46,7 +46,7 @@ //------------------------------------------------------------------ /// Constructor //------------------------------------------------------------------ - explicit DWARFExpression(DWARFCompileUnit *dwarf_cu); + explicit DWARFExpression(DWARFUnit *dwarf_cu); //------------------------------------------------------------------ /// Constructor @@ -62,7 +62,7 @@ /// The byte length of the location expression. //------------------------------------------------------------------ DWARFExpression(lldb::ModuleSP module, const DataExtractor &data, - DWARFCompileUnit *dwarf_cu, lldb::offset_t data_offset, + DWARFUnit *dwarf_cu, lldb::offset_t data_offset, lldb::offset_t data_length); //------------------------------------------------------------------ @@ -332,7 +332,7 @@ //------------------------------------------------------------------ static bool Evaluate(ExecutionContext *exe_ctx, RegisterContext *reg_ctx, lldb::ModuleSP opcode_ctx, const DataExtractor &opcodes, - DWARFCompileUnit *dwarf_cu, const lldb::offset_t offset, + DWARFUnit *dwarf_cu, const lldb::offset_t offset, const lldb::offset_t length, const lldb::RegisterKind reg_set, const Value *initial_value_ptr, @@ -348,7 +348,7 @@ lldb::addr_t loclist_base_load_addr, lldb::addr_t address, ABI *abi); - static size_t LocationListSize(const DWARFCompileUnit *dwarf_cu, + static size_t LocationListSize(const DWARFUnit *dwarf_cu, const DataExtractor &debug_loc_data, lldb::offset_t offset); @@ -356,7 +356,7 @@ int address_size, int dwarf_ref_size, bool location_expression); - static void PrintDWARFLocationList(Stream &s, const DWARFCompileUnit *cu, + static void PrintDWARFLocationList(Stream &s, const DWARFUnit *cu, const DataExtractor &debug_loc_data, lldb::offset_t offset); @@ -389,7 +389,7 @@ lldb::offset_t &offset, lldb::offset_t &len); static bool AddressRangeForLocationListEntry( - const DWARFCompileUnit *dwarf_cu, const DataExtractor &debug_loc_data, + const DWARFUnit *dwarf_cu, const DataExtractor &debug_loc_data, lldb::offset_t *offset_ptr, lldb::addr_t &low_pc, lldb::addr_t &high_pc); bool GetOpAndEndOffsets(StackFrame &frame, lldb::offset_t &op_offset, @@ -401,7 +401,7 @@ lldb::ModuleWP m_module_wp; ///< Module which defined this expression. DataExtractor m_data; ///< A data extractor capable of reading opcode bytes - DWARFCompileUnit *m_dwarf_cu; ///< The DWARF compile unit this expression + DWARFUnit *m_dwarf_cu; ///< The DWARF compile unit this expression ///belongs to. It is used ///< to evaluate values indexing into the .debug_addr section (e.g. ///< DW_OP_GNU_addr_index, DW_OP_GNU_const_index) Index: lldb/trunk/source/Expression/DWARFExpression.cpp =================================================================== --- lldb/trunk/source/Expression/DWARFExpression.cpp +++ lldb/trunk/source/Expression/DWARFExpression.cpp @@ -37,13 +37,13 @@ #include "lldb/Target/StackID.h" #include "lldb/Target/Thread.h" -#include "Plugins/SymbolFile/DWARF/DWARFCompileUnit.h" +#include "Plugins/SymbolFile/DWARF/DWARFUnit.h" using namespace lldb; using namespace lldb_private; static lldb::addr_t -ReadAddressFromDebugAddrSection(const DWARFCompileUnit *dwarf_cu, +ReadAddressFromDebugAddrSection(const DWARFUnit *dwarf_cu, uint32_t index) { uint32_t index_size = dwarf_cu->GetAddressByteSize(); dw_offset_t addr_base = dwarf_cu->GetAddrBase(); @@ -55,7 +55,7 @@ //---------------------------------------------------------------------- // DWARFExpression constructor //---------------------------------------------------------------------- -DWARFExpression::DWARFExpression(DWARFCompileUnit *dwarf_cu) +DWARFExpression::DWARFExpression(DWARFUnit *dwarf_cu) : m_module_wp(), m_data(), m_dwarf_cu(dwarf_cu), m_reg_kind(eRegisterKindDWARF), m_loclist_slide(LLDB_INVALID_ADDRESS) {} @@ -66,7 +66,7 @@ DWARFExpression::DWARFExpression(lldb::ModuleSP module_sp, const DataExtractor &data, - DWARFCompileUnit *dwarf_cu, + DWARFUnit *dwarf_cu, lldb::offset_t data_offset, lldb::offset_t data_length) : m_module_wp(), m_data(data, data_offset, data_length), @@ -1323,7 +1323,7 @@ bool DWARFExpression::Evaluate( ExecutionContext *exe_ctx, RegisterContext *reg_ctx, lldb::ModuleSP module_sp, const DataExtractor &opcodes, - DWARFCompileUnit *dwarf_cu, const lldb::offset_t opcodes_offset, + DWARFUnit *dwarf_cu, const lldb::offset_t opcodes_offset, const lldb::offset_t opcodes_length, const lldb::RegisterKind reg_kind, const Value *initial_value_ptr, const Value *object_address_ptr, Value &result, Status *error_ptr) { @@ -2984,7 +2984,7 @@ return true; // Return true on success } -size_t DWARFExpression::LocationListSize(const DWARFCompileUnit *dwarf_cu, +size_t DWARFExpression::LocationListSize(const DWARFUnit *dwarf_cu, const DataExtractor &debug_loc_data, lldb::offset_t offset) { const lldb::offset_t debug_loc_offset = offset; @@ -3008,7 +3008,7 @@ } bool DWARFExpression::AddressRangeForLocationListEntry( - const DWARFCompileUnit *dwarf_cu, const DataExtractor &debug_loc_data, + const DWARFUnit *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; @@ -3242,11 +3242,11 @@ } void DWARFExpression::PrintDWARFLocationList( - Stream &s, const DWARFCompileUnit *cu, const DataExtractor &debug_loc_data, + Stream &s, const DWARFUnit *cu, const DataExtractor &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)); + uint32_t addr_size = DWARFUnit::GetAddressByteSize(cu); + s.SetAddressByteSize(DWARFUnit::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); Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/DIERef.cpp =================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/DIERef.cpp +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DIERef.cpp @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// #include "DIERef.h" -#include "DWARFCompileUnit.h" +#include "DWARFUnit.h" #include "DWARFDebugInfo.h" #include "DWARFFormValue.h" #include "SymbolFileDWARF.h" @@ -28,7 +28,7 @@ if (actual_dwarf) { DWARFDebugInfo *debug_info = actual_dwarf->DebugInfo(); if (debug_info) { - DWARFCompileUnit *dwarf_cu = + DWARFUnit *dwarf_cu = debug_info->GetCompileUnitContainingDIEOffset(die_offset); if (dwarf_cu) { cu_offset = dwarf_cu->GetOffset(); @@ -45,7 +45,7 @@ DIERef::DIERef(const DWARFFormValue &form_value) : cu_offset(DW_INVALID_OFFSET), die_offset(DW_INVALID_OFFSET) { if (form_value.IsValid()) { - const DWARFCompileUnit *dwarf_cu = form_value.GetCompileUnit(); + const DWARFUnit *dwarf_cu = form_value.GetCompileUnit(); if (dwarf_cu) { if (dwarf_cu->GetBaseObjOffset() != DW_INVALID_OFFSET) cu_offset = dwarf_cu->GetBaseObjOffset(); Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserJava.cpp =================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserJava.cpp +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserJava.cpp @@ -9,7 +9,7 @@ #include "DWARFASTParserJava.h" #include "DWARFAttribute.h" -#include "DWARFCompileUnit.h" +#include "DWARFUnit.h" #include "DWARFDebugInfoEntry.h" #include "DWARFDebugInfoEntry.h" #include "DWARFDeclContext.h" @@ -418,7 +418,7 @@ void DWARFASTParserJava::ParseChildMembers(const DWARFDIE &parent_die, CompilerType &compiler_type) { - DWARFCompileUnit *dwarf_cu = parent_die.GetCU(); + DWARFUnit *dwarf_cu = parent_die.GetCU(); for (DWARFDIE die = parent_die.GetFirstChild(); die.IsValid(); die = die.GetSibling()) { switch (die.Tag()) { Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFAttribute.h =================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFAttribute.h +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFAttribute.h @@ -14,7 +14,7 @@ #include "llvm/ADT/SmallVector.h" #include -class DWARFCompileUnit; +class DWARFUnit; class DWARFFormValue; class DWARFAttribute { @@ -50,9 +50,9 @@ DWARFAttributes(); ~DWARFAttributes(); - void Append(const DWARFCompileUnit *cu, dw_offset_t attr_die_offset, + void Append(const DWARFUnit *cu, dw_offset_t attr_die_offset, dw_attr_t attr, dw_form_t form); - const DWARFCompileUnit *CompileUnitAtIndex(uint32_t i) const { + const DWARFUnit *CompileUnitAtIndex(uint32_t i) const { return m_infos[i].cu; } dw_offset_t DIEOffsetAtIndex(uint32_t i) const { @@ -73,7 +73,7 @@ protected: struct AttributeValue { - const DWARFCompileUnit *cu; // Keep the compile unit with each attribute in + const DWARFUnit *cu; // Keep the compile unit with each attribute in // case we have DW_FORM_ref_addr values dw_offset_t die_offset; DWARFAttribute attr; Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFAttribute.cpp =================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFAttribute.cpp +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFAttribute.cpp @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// #include "DWARFAttribute.h" -#include "DWARFCompileUnit.h" +#include "DWARFUnit.h" #include "DWARFDebugInfo.h" DWARFAttributes::DWARFAttributes() : m_infos() {} @@ -26,7 +26,7 @@ return UINT32_MAX; } -void DWARFAttributes::Append(const DWARFCompileUnit *cu, +void DWARFAttributes::Append(const DWARFUnit *cu, dw_offset_t attr_die_offset, dw_attr_t attr, dw_form_t form) { AttributeValue attr_value = {cu, attr_die_offset, {attr, form}}; @@ -48,7 +48,7 @@ bool DWARFAttributes::ExtractFormValueAtIndex( uint32_t i, DWARFFormValue &form_value) const { - const DWARFCompileUnit *cu = CompileUnitAtIndex(i); + const DWARFUnit *cu = CompileUnitAtIndex(i); form_value.SetCompileUnit(cu); form_value.SetForm(FormAtIndex(i)); lldb::offset_t offset = DIEOffsetAtIndex(i); Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h =================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h @@ -12,13 +12,11 @@ #include "DWARFUnit.h" -typedef std::shared_ptr DWARFCompileUnitSP; - class DWARFCompileUnit : public DWARFUnit { friend class DWARFUnit; public: - static DWARFCompileUnitSP Extract(SymbolFileDWARF *dwarf2Data, + static DWARFUnitSP Extract(SymbolFileDWARF *dwarf2Data, lldb::offset_t *offset_ptr); size_t ExtractDIEsIfNeeded(bool cu_die_only); Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp =================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp @@ -40,9 +40,10 @@ DWARFCompileUnit::DWARFCompileUnit(SymbolFileDWARF *dwarf2Data) : m_dwarf2Data(dwarf2Data) {} -DWARFCompileUnitSP DWARFCompileUnit::Extract(SymbolFileDWARF *dwarf2Data, +DWARFUnitSP DWARFCompileUnit::Extract(SymbolFileDWARF *dwarf2Data, lldb::offset_t *offset_ptr) { - DWARFCompileUnitSP cu_sp(new DWARFCompileUnit(dwarf2Data)); + // std::make_shared would require the ctor to be public. + std::shared_ptr cu_sp(new DWARFCompileUnit(dwarf2Data)); // Out of memory? if (cu_sp.get() == NULL) return nullptr; @@ -249,7 +250,7 @@ if (!m_dwo_symbol_file) return m_die_array.size(); - DWARFCompileUnit *dwo_cu = m_dwo_symbol_file->GetCompileUnit(); + DWARFUnit *dwo_cu = m_dwo_symbol_file->GetCompileUnit(); size_t dwo_die_count = dwo_cu->ExtractDIEsIfNeeded(cu_die_only); return m_die_array.size() + dwo_die_count - 1; // We have 2 CU die, but we want to count it only as one @@ -265,7 +266,7 @@ if (!dwo_symbol_file) return; - DWARFCompileUnit *dwo_cu = dwo_symbol_file->GetCompileUnit(); + DWARFUnit *dwo_cu = dwo_symbol_file->GetCompileUnit(); if (!dwo_cu) return; // Can't fetch the compile unit from the dwo file. @@ -466,7 +467,7 @@ m_func_aranges_ap.get()); if (m_dwo_symbol_file) { - DWARFCompileUnit *dwo_cu = m_dwo_symbol_file->GetCompileUnit(); + DWARFUnit *dwo_cu = m_dwo_symbol_file->GetCompileUnit(); const DWARFDebugInfoEntry *dwo_die = dwo_cu->DIEPtr(); if (dwo_die) dwo_die->BuildFunctionAddressRangeTable(m_dwo_symbol_file.get(), dwo_cu, Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.h =================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.h +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.h @@ -16,7 +16,7 @@ struct DIERef; class DWARFASTParser; class DWARFAttributes; -class DWARFCompileUnit; +class DWARFUnit; class DWARFDebugInfoEntry; class DWARFDeclContext; class DWARFDIECollection; @@ -26,17 +26,17 @@ public: DWARFDIE() : m_cu(nullptr), m_die(nullptr) {} - DWARFDIE(DWARFCompileUnit *cu, DWARFDebugInfoEntry *die) + DWARFDIE(DWARFUnit *cu, DWARFDebugInfoEntry *die) : m_cu(cu), m_die(die) {} - DWARFDIE(const DWARFCompileUnit *cu, DWARFDebugInfoEntry *die) - : m_cu(const_cast(cu)), m_die(die) {} + DWARFDIE(const DWARFUnit *cu, DWARFDebugInfoEntry *die) + : m_cu(const_cast(cu)), m_die(die) {} - DWARFDIE(DWARFCompileUnit *cu, const DWARFDebugInfoEntry *die) + DWARFDIE(DWARFUnit *cu, const DWARFDebugInfoEntry *die) : m_cu(cu), m_die(const_cast(die)) {} - DWARFDIE(const DWARFCompileUnit *cu, const DWARFDebugInfoEntry *die) - : m_cu(const_cast(cu)), + DWARFDIE(const DWARFUnit *cu, const DWARFDebugInfoEntry *die) + : m_cu(const_cast(cu)), m_die(const_cast(die)) {} //---------------------------------------------------------------------- @@ -57,7 +57,7 @@ //---------------------------------------------------------------------- SymbolFileDWARF *GetDWARF() const; - DWARFCompileUnit *GetCU() const { return m_cu; } + DWARFUnit *GetCU() const { return m_cu; } DWARFDebugInfoEntry *GetDIE() const { return m_die; } @@ -67,7 +67,7 @@ DWARFASTParser *GetDWARFParser() const; - void Set(DWARFCompileUnit *cu, DWARFDebugInfoEntry *die) { + void Set(DWARFUnit *cu, DWARFDebugInfoEntry *die) { if (cu && die) { m_cu = cu; m_die = die; @@ -211,7 +211,7 @@ lldb_private::CompilerDeclContext GetContainingDeclContext() const; protected: - DWARFCompileUnit *m_cu; + DWARFUnit *m_cu; DWARFDebugInfoEntry *m_die; }; Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp =================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp @@ -10,7 +10,7 @@ #include "DWARFDIE.h" #include "DWARFASTParser.h" -#include "DWARFCompileUnit.h" +#include "DWARFUnit.h" #include "DWARFDIECollection.h" #include "DWARFDebugAbbrev.h" #include "DWARFDebugAranges.h" @@ -121,7 +121,7 @@ DWARFDIE DWARFDIE::GetAttributeValueAsReferenceDIE(const dw_attr_t attr) const { if (IsValid()) { - DWARFCompileUnit *cu = GetCU(); + DWARFUnit *cu = GetCU(); SymbolFileDWARF *dwarf = cu->GetSymbolFileDWARF(); const bool check_specification_or_abstract_origin = true; DWARFFormValue form_value; @@ -154,7 +154,7 @@ DWARFDIE::LookupDeepestBlock(lldb::addr_t file_addr) const { if (IsValid()) { SymbolFileDWARF *dwarf = GetDWARF(); - DWARFCompileUnit *cu = GetCU(); + DWARFUnit *cu = GetCU(); DWARFDebugInfoEntry *function_die = nullptr; DWARFDebugInfoEntry *block_die = nullptr; if (m_die->LookupAddress(file_addr, dwarf, cu, &function_die, &block_die)) { Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp =================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp @@ -18,7 +18,7 @@ #include "lldb/Utility/Stream.h" #include "lldb/Utility/Timer.h" -#include "DWARFCompileUnit.h" +#include "DWARFUnit.h" #include "DWARFDebugInfo.h" #include "LogChannelDWARF.h" #include "SymbolFileDWARF.h" @@ -82,7 +82,7 @@ uint32_t cu_idx = 0; const uint32_t num_compile_units = dwarf2Data->GetNumCompileUnits(); for (cu_idx = 0; cu_idx < num_compile_units; ++cu_idx) { - DWARFCompileUnit *cu = debug_info->GetCompileUnitAtIndex(cu_idx); + DWARFUnit *cu = debug_info->GetCompileUnitAtIndex(cu_idx); if (cu) cu->BuildAddressRangeTable(dwarf2Data, this); } Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h =================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h @@ -13,7 +13,7 @@ #include #include -#include "DWARFCompileUnit.h" +#include "DWARFUnit.h" #include "DWARFDIE.h" #include "SymbolFileDWARF.h" #include "lldb/Core/STLUtils.h" @@ -27,7 +27,7 @@ class DWARFDebugInfo { public: typedef dw_offset_t (*Callback)(SymbolFileDWARF *dwarf2Data, - DWARFCompileUnit *cu, + DWARFUnit *cu, DWARFDebugInfoEntry *die, const dw_offset_t next_offset, const uint32_t depth, void *userData); @@ -36,12 +36,11 @@ void SetDwarfData(SymbolFileDWARF *dwarf2Data); size_t GetNumCompileUnits(); - bool ContainsCompileUnit(const DWARFCompileUnit *cu) const; - DWARFCompileUnit *GetCompileUnitAtIndex(uint32_t idx); - DWARFCompileUnit *GetCompileUnit(dw_offset_t cu_offset, - uint32_t *idx_ptr = NULL); - DWARFCompileUnit *GetCompileUnitContainingDIEOffset(dw_offset_t die_offset); - DWARFCompileUnit *GetCompileUnit(const DIERef &die_ref); + bool ContainsCompileUnit(const DWARFUnit *cu) const; + DWARFUnit *GetCompileUnitAtIndex(uint32_t idx); + DWARFUnit *GetCompileUnit(dw_offset_t cu_offset, uint32_t *idx_ptr = NULL); + DWARFUnit *GetCompileUnitContainingDIEOffset(dw_offset_t die_offset); + DWARFUnit *GetCompileUnit(const DIERef &die_ref); DWARFDIE GetDIEForDIEOffset(dw_offset_t die_offset); DWARFDIE GetDIE(const DIERef &die_ref); @@ -63,9 +62,9 @@ protected: static bool OffsetLessThanCompileUnitOffset(dw_offset_t offset, - const DWARFCompileUnitSP &cu_sp); + const DWARFUnitSP &cu_sp); - typedef std::vector CompileUnitColl; + typedef std::vector CompileUnitColl; //---------------------------------------------------------------------- // Member variables Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp =================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp @@ -72,7 +72,7 @@ bool printed = false; const size_t num_compile_units = GetNumCompileUnits(); for (size_t idx = 0; idx < num_compile_units; ++idx) { - DWARFCompileUnit *cu = GetCompileUnitAtIndex(idx); + DWARFUnit *cu = GetCompileUnitAtIndex(idx); dw_offset_t offset = cu->GetOffset(); if (cus_with_data.find(offset) == cus_with_data.end()) { @@ -97,7 +97,7 @@ if (m_compile_units.empty()) { if (m_dwarf2Data != NULL) { lldb::offset_t offset = 0; - DWARFCompileUnitSP cu_sp; + DWARFUnitSP cu_sp; while ((cu_sp = DWARFCompileUnit::Extract(m_dwarf2Data, &offset))) { m_compile_units.push_back(cu_sp); @@ -112,14 +112,14 @@ return m_compile_units.size(); } -DWARFCompileUnit *DWARFDebugInfo::GetCompileUnitAtIndex(uint32_t idx) { - DWARFCompileUnit *cu = NULL; +DWARFUnit *DWARFDebugInfo::GetCompileUnitAtIndex(uint32_t idx) { + DWARFUnit *cu = NULL; if (idx < GetNumCompileUnits()) cu = m_compile_units[idx].get(); return cu; } -bool DWARFDebugInfo::ContainsCompileUnit(const DWARFCompileUnit *cu) const { +bool DWARFDebugInfo::ContainsCompileUnit(const DWARFUnit *cu) const { // Not a verify efficient function, but it is handy for use in assertions // to make sure that a compile unit comes from a debug information file. CompileUnitColl::const_iterator end_pos = m_compile_units.end(); @@ -133,13 +133,13 @@ } bool DWARFDebugInfo::OffsetLessThanCompileUnitOffset( - dw_offset_t offset, const DWARFCompileUnitSP &cu_sp) { + dw_offset_t offset, const DWARFUnitSP &cu_sp) { return offset < cu_sp->GetOffset(); } -DWARFCompileUnit *DWARFDebugInfo::GetCompileUnit(dw_offset_t cu_offset, +DWARFUnit *DWARFDebugInfo::GetCompileUnit(dw_offset_t cu_offset, uint32_t *idx_ptr) { - DWARFCompileUnitSP cu_sp; + DWARFUnitSP cu_sp; uint32_t cu_idx = DW_INVALID_INDEX; if (cu_offset != DW_INVALID_OFFSET) { ParseCompileUnitHeadersIfNeeded(); @@ -170,18 +170,18 @@ return cu_sp.get(); } -DWARFCompileUnit *DWARFDebugInfo::GetCompileUnit(const DIERef &die_ref) { +DWARFUnit *DWARFDebugInfo::GetCompileUnit(const DIERef &die_ref) { if (die_ref.cu_offset == DW_INVALID_OFFSET) return GetCompileUnitContainingDIEOffset(die_ref.die_offset); else return GetCompileUnit(die_ref.cu_offset); } -DWARFCompileUnit * +DWARFUnit * DWARFDebugInfo::GetCompileUnitContainingDIEOffset(dw_offset_t die_offset) { ParseCompileUnitHeadersIfNeeded(); - DWARFCompileUnitSP cu_sp; + DWARFUnitSP cu_sp; // Watch out for single compile unit executable as they are pretty common const size_t num_cus = m_compile_units.size(); @@ -205,7 +205,7 @@ DWARFDIE DWARFDebugInfo::GetDIEForDIEOffset(dw_offset_t die_offset) { - DWARFCompileUnit *cu = GetCompileUnitContainingDIEOffset(die_offset); + DWARFUnit *cu = GetCompileUnitContainingDIEOffset(die_offset); if (cu) return cu->GetDIE(die_offset); return DWARFDIE(); @@ -218,7 +218,7 @@ //---------------------------------------------------------------------- DWARFDIE DWARFDebugInfo::GetDIE(const DIERef &die_ref) { - DWARFCompileUnit *cu = GetCompileUnit(die_ref); + DWARFUnit *cu = GetCompileUnit(die_ref); if (cu) return cu->GetDIE(die_ref.die_offset); return DWARFDIE(); // Not found @@ -241,7 +241,7 @@ uint32_t depth = 0; DWARFDebugInfoEntry die; - DWARFCompileUnitSP cu; + DWARFUnitSP cu; while ((cu = DWARFCompileUnit::Extract(dwarf2Data, &offset))) { const dw_offset_t next_cu_offset = cu->GetNextCompileUnitOffset(); @@ -308,7 +308,7 @@ // whether a single DIE is to be dumped (or all of the data). //---------------------------------------------------------------------- static dw_offset_t DumpCallback(SymbolFileDWARF *dwarf2Data, - DWARFCompileUnit *cu, DWARFDebugInfoEntry *die, + DWARFUnit *cu, DWARFDebugInfoEntry *die, const dw_offset_t next_offset, const uint32_t curr_depth, void *userData) { DumpInfo *dumpInfo = (DumpInfo *)userData; @@ -482,7 +482,7 @@ uint32_t curr_depth = 0; ParseCompileUnitHeadersIfNeeded(); for (pos = m_compile_units.begin(); pos != m_compile_units.end(); ++pos) { - DWARFCompileUnit *cu = pos->get(); + DWARFUnit *cu = pos->get(); DumpCallback(m_dwarf2Data, cu, NULL, 0, curr_depth, &dumpInfo); const DWARFDIE die = cu->DIE(); Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h =================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h @@ -61,127 +61,127 @@ m_tag(0) {} void BuildAddressRangeTable(SymbolFileDWARF *dwarf2Data, - const DWARFCompileUnit *cu, + const DWARFUnit *cu, DWARFDebugAranges *debug_aranges) const; void BuildFunctionAddressRangeTable(SymbolFileDWARF *dwarf2Data, - const DWARFCompileUnit *cu, + const DWARFUnit *cu, DWARFDebugAranges *debug_aranges) const; bool FastExtract(const lldb_private::DWARFDataExtractor &debug_info_data, - const DWARFCompileUnit *cu, + const DWARFUnit *cu, const DWARFFormValue::FixedFormSizes &fixed_form_sizes, lldb::offset_t *offset_ptr); - bool Extract(SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, + bool Extract(SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, lldb::offset_t *offset_ptr); bool LookupAddress(const dw_addr_t address, SymbolFileDWARF *dwarf2Data, - const DWARFCompileUnit *cu, + const DWARFUnit *cu, DWARFDebugInfoEntry **function_die, DWARFDebugInfoEntry **block_die); - size_t GetAttributes(const DWARFCompileUnit *cu, + size_t GetAttributes(const DWARFUnit *cu, DWARFFormValue::FixedFormSizes fixed_form_sizes, DWARFAttributes &attrs, uint32_t curr_depth = 0) const; // "curr_depth" for internal use only, don't set this yourself!!! dw_offset_t - GetAttributeValue(SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, + GetAttributeValue(SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, const dw_attr_t attr, DWARFFormValue &formValue, dw_offset_t *end_attr_offset_ptr = nullptr, bool check_specification_or_abstract_origin = false) const; const char *GetAttributeValueAsString( - SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, + SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, const dw_attr_t attr, const char *fail_value, bool check_specification_or_abstract_origin = false) const; uint64_t GetAttributeValueAsUnsigned( - SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, + SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, const dw_attr_t attr, uint64_t fail_value, bool check_specification_or_abstract_origin = false) const; uint64_t GetAttributeValueAsReference( - SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, + SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, const dw_attr_t attr, uint64_t fail_value, bool check_specification_or_abstract_origin = false) const; int64_t GetAttributeValueAsSigned( - SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, + SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, const dw_attr_t attr, int64_t fail_value, bool check_specification_or_abstract_origin = false) const; uint64_t GetAttributeValueAsAddress( - SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, + SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, const dw_attr_t attr, uint64_t fail_value, bool check_specification_or_abstract_origin = false) const; dw_addr_t - GetAttributeHighPC(SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, + GetAttributeHighPC(SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, dw_addr_t lo_pc, uint64_t fail_value, bool check_specification_or_abstract_origin = false) const; bool GetAttributeAddressRange( - SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, dw_addr_t &lo_pc, + SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, dw_addr_t &lo_pc, dw_addr_t &hi_pc, uint64_t fail_value, bool check_specification_or_abstract_origin = false) const; size_t GetAttributeAddressRanges( - SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, + SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, DWARFRangeList &ranges, bool check_hi_lo_pc, bool check_specification_or_abstract_origin = false) const; const char *GetName(SymbolFileDWARF *dwarf2Data, - const DWARFCompileUnit *cu) const; + const DWARFUnit *cu) const; const char *GetMangledName(SymbolFileDWARF *dwarf2Data, - const DWARFCompileUnit *cu, + const DWARFUnit *cu, bool substitute_name_allowed = true) const; const char *GetPubname(SymbolFileDWARF *dwarf2Data, - const DWARFCompileUnit *cu) const; + const DWARFUnit *cu) const; - static bool GetName(SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, + static bool GetName(SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, const dw_offset_t die_offset, lldb_private::Stream &s); static bool AppendTypeName(SymbolFileDWARF *dwarf2Data, - const DWARFCompileUnit *cu, + const DWARFUnit *cu, const dw_offset_t die_offset, lldb_private::Stream &s); const char *GetQualifiedName(SymbolFileDWARF *dwarf2Data, - DWARFCompileUnit *cu, + DWARFUnit *cu, std::string &storage) const; const char *GetQualifiedName(SymbolFileDWARF *dwarf2Data, - DWARFCompileUnit *cu, + DWARFUnit *cu, const DWARFAttributes &attributes, std::string &storage) const; static bool OffsetLessThan(const DWARFDebugInfoEntry &a, const DWARFDebugInfoEntry &b); - void Dump(SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, + void Dump(SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, lldb_private::Stream &s, uint32_t recurse_depth) const; - void DumpAncestry(SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, + void DumpAncestry(SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, const DWARFDebugInfoEntry *oldest, lldb_private::Stream &s, uint32_t recurse_depth) const; static void - DumpAttribute(SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, + DumpAttribute(SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, const lldb_private::DWARFDataExtractor &debug_info_data, lldb::offset_t *offset_ptr, lldb_private::Stream &s, dw_attr_t attr, dw_form_t form); // This one dumps the comp unit name, objfile name and die offset for this die // so the stream S. - void DumpLocation(SymbolFileDWARF *dwarf2Data, DWARFCompileUnit *cu, + void DumpLocation(SymbolFileDWARF *dwarf2Data, DWARFUnit *cu, lldb_private::Stream &s) const; bool - GetDIENamesAndRanges(SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, + GetDIENamesAndRanges(SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, const char *&name, const char *&mangled, DWARFRangeList &rangeList, int &decl_file, int &decl_line, int &decl_column, int &call_file, @@ -190,7 +190,7 @@ const DWARFAbbreviationDeclaration * GetAbbreviationDeclarationPtr(SymbolFileDWARF *dwarf2Data, - const DWARFCompileUnit *cu, + const DWARFUnit *cu, lldb::offset_t &offset) const; dw_tag_t Tag() const { return m_tag; } @@ -229,20 +229,20 @@ return (HasChildren() && !m_empty_children) ? this + 1 : NULL; } - void GetDeclContextDIEs(DWARFCompileUnit *cu, + void GetDeclContextDIEs(DWARFUnit *cu, DWARFDIECollection &decl_context_dies) const; - void GetDWARFDeclContext(SymbolFileDWARF *dwarf2Data, DWARFCompileUnit *cu, + void GetDWARFDeclContext(SymbolFileDWARF *dwarf2Data, DWARFUnit *cu, DWARFDeclContext &dwarf_decl_ctx) const; bool MatchesDWARFDeclContext(SymbolFileDWARF *dwarf2Data, - DWARFCompileUnit *cu, + DWARFUnit *cu, const DWARFDeclContext &dwarf_decl_ctx) const; DWARFDIE GetParentDeclContextDIE(SymbolFileDWARF *dwarf2Data, - DWARFCompileUnit *cu) const; + DWARFUnit *cu) const; DWARFDIE GetParentDeclContextDIE(SymbolFileDWARF *dwarf2Data, - DWARFCompileUnit *cu, + DWARFUnit *cu, const DWARFAttributes &attributes) const; void SetParent(DWARFDebugInfoEntry *parent) { Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp =================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp @@ -18,7 +18,7 @@ #include "lldb/Symbol/ObjectFile.h" #include "lldb/Utility/Stream.h" -#include "DWARFCompileUnit.h" +#include "DWARFUnit.h" #include "DWARFDIECollection.h" #include "DWARFDebugAbbrev.h" #include "DWARFDebugAranges.h" @@ -34,7 +34,7 @@ extern int g_verbose; bool DWARFDebugInfoEntry::FastExtract( - const DWARFDataExtractor &debug_info_data, const DWARFCompileUnit *cu, + const DWARFDataExtractor &debug_info_data, const DWARFUnit *cu, const DWARFFormValue::FixedFormSizes &fixed_form_sizes, lldb::offset_t *offset_ptr) { m_offset = *offset_ptr; @@ -194,7 +194,7 @@ // starting at the given offset //---------------------------------------------------------------------- bool DWARFDebugInfoEntry::Extract(SymbolFileDWARF *dwarf2Data, - const DWARFCompileUnit *cu, + const DWARFUnit *cu, lldb::offset_t *offset_ptr) { const DWARFDataExtractor &debug_info_data = dwarf2Data->get_debug_info_data(); // const DWARFDataExtractor& debug_str_data = @@ -220,7 +220,7 @@ bool isCompileUnitTag = m_tag == DW_TAG_compile_unit; if (cu && isCompileUnitTag) - const_cast(cu)->SetBaseAddress(0); + const_cast(cu)->SetBaseAddress(0); // Skip all data in the .debug_info for the attributes const uint32_t numAttributes = abbrevDecl->NumAttributes(); @@ -235,7 +235,7 @@ DWARFFormValue form_value(cu, form); if (form_value.ExtractValue(debug_info_data, &offset)) { if (attr == DW_AT_low_pc || attr == DW_AT_entry_pc) - const_cast(cu)->SetBaseAddress( + const_cast(cu)->SetBaseAddress( form_value.Address()); } } else { @@ -360,7 +360,7 @@ // all of it's attributes to the specified stream. //---------------------------------------------------------------------- void DWARFDebugInfoEntry::DumpAncestry(SymbolFileDWARF *dwarf2Data, - const DWARFCompileUnit *cu, + const DWARFUnit *cu, const DWARFDebugInfoEntry *oldest, Stream &s, uint32_t recurse_depth) const { @@ -378,7 +378,7 @@ // attributes. //---------------------------------------------------------------------- bool DWARFDebugInfoEntry::GetDIENamesAndRanges( - SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, const char *&name, + SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, const char *&name, const char *&mangled, DWARFRangeList &ranges, int &decl_file, int &decl_line, int &decl_column, int &call_file, int &call_line, int &call_column, DWARFExpression *frame_base) const { @@ -586,7 +586,7 @@ // specified stream. //---------------------------------------------------------------------- void DWARFDebugInfoEntry::Dump(SymbolFileDWARF *dwarf2Data, - const DWARFCompileUnit *cu, Stream &s, + const DWARFUnit *cu, Stream &s, uint32_t recurse_depth) const { const DWARFDataExtractor &debug_info_data = dwarf2Data->get_debug_info_data(); lldb::offset_t offset = m_offset; @@ -639,7 +639,7 @@ } void DWARFDebugInfoEntry::DumpLocation(SymbolFileDWARF *dwarf2Data, - DWARFCompileUnit *cu, Stream &s) const { + DWARFUnit *cu, Stream &s) const { const DWARFDIE cu_die = cu->GetCompileUnitDIEOnly(); const char *cu_name = NULL; if (cu_die) @@ -663,7 +663,7 @@ // show enumeration values for attributes, etc). //---------------------------------------------------------------------- void DWARFDebugInfoEntry::DumpAttribute( - SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, + SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, const DWARFDataExtractor &debug_info_data, lldb::offset_t *offset_ptr, Stream &s, dw_attr_t attr, dw_form_t form) { bool show_form = s.GetFlags().Test(DWARFDebugInfo::eDumpFlag_ShowForm); @@ -714,7 +714,7 @@ (*offset_ptr) - form_value.Unsigned(), form_value.Unsigned()); DWARFExpression::PrintDWARFExpression( - s, locationData, DWARFCompileUnit::GetAddressByteSize(cu), 4, false); + s, locationData, DWARFUnit::GetAddressByteSize(cu), 4, false); } else { // We have a location list offset as the value that is // the offset into the .debug_loc section that describes @@ -764,7 +764,7 @@ // take precedence (this can happen for declaration attributes). //---------------------------------------------------------------------- size_t DWARFDebugInfoEntry::GetAttributes( - const DWARFCompileUnit *cu, DWARFFormValue::FixedFormSizes fixed_form_sizes, + const DWARFUnit *cu, DWARFFormValue::FixedFormSizes fixed_form_sizes, DWARFAttributes &attributes, uint32_t curr_depth) const { SymbolFileDWARF *dwarf2Data = nullptr; const DWARFAbbreviationDeclaration *abbrevDecl = nullptr; @@ -819,7 +819,7 @@ if (form_value.ExtractValue(debug_info_data, &offset)) { dw_offset_t die_offset = form_value.Reference(); DWARFDIE spec_die = - const_cast(cu)->GetDIE(die_offset); + const_cast(cu)->GetDIE(die_offset); if (spec_die) spec_die.GetAttributes(attributes, curr_depth + 1); } @@ -846,7 +846,7 @@ // would be a compile unit header). //---------------------------------------------------------------------- dw_offset_t DWARFDebugInfoEntry::GetAttributeValue( - SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, + SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, const dw_attr_t attr, DWARFFormValue &form_value, dw_offset_t *end_attr_offset_ptr, bool check_specification_or_abstract_origin) const { @@ -886,7 +886,7 @@ if (check_specification_or_abstract_origin) { if (GetAttributeValue(dwarf2Data, cu, DW_AT_specification, form_value)) { DWARFDIE die = - const_cast(cu)->GetDIE(form_value.Reference()); + const_cast(cu)->GetDIE(form_value.Reference()); if (die) { dw_offset_t die_offset = die.GetDIE()->GetAttributeValue( die.GetDWARF(), die.GetCU(), attr, form_value, end_attr_offset_ptr, @@ -898,7 +898,7 @@ if (GetAttributeValue(dwarf2Data, cu, DW_AT_abstract_origin, form_value)) { DWARFDIE die = - const_cast(cu)->GetDIE(form_value.Reference()); + const_cast(cu)->GetDIE(form_value.Reference()); if (die) { dw_offset_t die_offset = die.GetDIE()->GetAttributeValue( die.GetDWARF(), die.GetCU(), attr, form_value, end_attr_offset_ptr, @@ -912,7 +912,7 @@ if (!dwo_symbol_file) return 0; - DWARFCompileUnit *dwo_cu = dwo_symbol_file->GetCompileUnit(); + DWARFUnit *dwo_cu = dwo_symbol_file->GetCompileUnit(); if (!dwo_cu) return 0; @@ -934,7 +934,7 @@ // and it's content doesn't change. //---------------------------------------------------------------------- const char *DWARFDebugInfoEntry::GetAttributeValueAsString( - SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, + SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, const dw_attr_t attr, const char *fail_value, bool check_specification_or_abstract_origin) const { DWARFFormValue form_value; @@ -950,7 +950,7 @@ // Get the value of an attribute as unsigned and return it. //---------------------------------------------------------------------- uint64_t DWARFDebugInfoEntry::GetAttributeValueAsUnsigned( - SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, + SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, const dw_attr_t attr, uint64_t fail_value, bool check_specification_or_abstract_origin) const { DWARFFormValue form_value; @@ -966,7 +966,7 @@ // Get the value of an attribute a signed value and return it. //---------------------------------------------------------------------- int64_t DWARFDebugInfoEntry::GetAttributeValueAsSigned( - SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, + SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, const dw_attr_t attr, int64_t fail_value, bool check_specification_or_abstract_origin) const { DWARFFormValue form_value; @@ -983,7 +983,7 @@ // unit relative offsets as needed. //---------------------------------------------------------------------- uint64_t DWARFDebugInfoEntry::GetAttributeValueAsReference( - SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, + SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, const dw_attr_t attr, uint64_t fail_value, bool check_specification_or_abstract_origin) const { DWARFFormValue form_value; @@ -994,7 +994,7 @@ } uint64_t DWARFDebugInfoEntry::GetAttributeValueAsAddress( - SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, + SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, const dw_attr_t attr, uint64_t fail_value, bool check_specification_or_abstract_origin) const { DWARFFormValue form_value; @@ -1013,7 +1013,7 @@ // Returns the hi_pc or fail_value. //---------------------------------------------------------------------- dw_addr_t DWARFDebugInfoEntry::GetAttributeHighPC( - SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, dw_addr_t lo_pc, + SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, dw_addr_t lo_pc, uint64_t fail_value, bool check_specification_or_abstract_origin) const { DWARFFormValue form_value; if (GetAttributeValue(dwarf2Data, cu, DW_AT_high_pc, form_value, nullptr, @@ -1037,7 +1037,7 @@ // Returns true or sets lo_pc and hi_pc to fail_value. //---------------------------------------------------------------------- bool DWARFDebugInfoEntry::GetAttributeAddressRange( - SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, dw_addr_t &lo_pc, + SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, dw_addr_t &lo_pc, dw_addr_t &hi_pc, uint64_t fail_value, bool check_specification_or_abstract_origin) const { lo_pc = GetAttributeValueAsAddress(dwarf2Data, cu, DW_AT_low_pc, fail_value, @@ -1054,7 +1054,7 @@ } size_t DWARFDebugInfoEntry::GetAttributeAddressRanges( - SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, + SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, DWARFRangeList &ranges, bool check_hi_lo_pc, bool check_specification_or_abstract_origin) const { ranges.Clear(); @@ -1087,7 +1087,7 @@ // else return NULL. //---------------------------------------------------------------------- const char *DWARFDebugInfoEntry::GetName(SymbolFileDWARF *dwarf2Data, - const DWARFCompileUnit *cu) const { + const DWARFUnit *cu) const { return GetAttributeValueAsString(dwarf2Data, cu, DW_AT_name, nullptr, true); } @@ -1099,7 +1099,7 @@ //---------------------------------------------------------------------- const char * DWARFDebugInfoEntry::GetMangledName(SymbolFileDWARF *dwarf2Data, - const DWARFCompileUnit *cu, + const DWARFUnit *cu, bool substitute_name_allowed) const { const char *name = nullptr; @@ -1127,7 +1127,7 @@ // .debug_pubnames or .debug_pubtypes section. //---------------------------------------------------------------------- const char *DWARFDebugInfoEntry::GetPubname(SymbolFileDWARF *dwarf2Data, - const DWARFCompileUnit *cu) const { + const DWARFUnit *cu) const { const char *name = nullptr; if (!dwarf2Data) return name; @@ -1156,7 +1156,7 @@ // then nothing is printed. //---------------------------------------------------------------------- bool DWARFDebugInfoEntry::GetName(SymbolFileDWARF *dwarf2Data, - const DWARFCompileUnit *cu, + const DWARFUnit *cu, const dw_offset_t die_offset, Stream &s) { if (dwarf2Data == NULL) { s.PutCString("NULL"); @@ -1190,7 +1190,7 @@ // a type identifier. //---------------------------------------------------------------------- bool DWARFDebugInfoEntry::AppendTypeName(SymbolFileDWARF *dwarf2Data, - const DWARFCompileUnit *cu, + const DWARFUnit *cu, const dw_offset_t die_offset, Stream &s) { if (dwarf2Data == NULL) { @@ -1318,7 +1318,7 @@ // BuildAddressRangeTable //---------------------------------------------------------------------- void DWARFDebugInfoEntry::BuildAddressRangeTable( - SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, + SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, DWARFDebugAranges *debug_aranges) const { if (m_tag) { if (m_tag == DW_TAG_subprogram) { @@ -1349,7 +1349,7 @@ // standard .debug_aranges section does it). //---------------------------------------------------------------------- void DWARFDebugInfoEntry::BuildFunctionAddressRangeTable( - SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, + SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, DWARFDebugAranges *debug_aranges) const { if (m_tag) { if (m_tag == DW_TAG_subprogram) { @@ -1372,14 +1372,14 @@ } void DWARFDebugInfoEntry::GetDeclContextDIEs( - DWARFCompileUnit *cu, DWARFDIECollection &decl_context_dies) const { + DWARFUnit *cu, DWARFDIECollection &decl_context_dies) const { DWARFDIE die(cu, const_cast(this)); die.GetDeclContextDIEs(decl_context_dies); } void DWARFDebugInfoEntry::GetDWARFDeclContext( - SymbolFileDWARF *dwarf2Data, DWARFCompileUnit *cu, + SymbolFileDWARF *dwarf2Data, DWARFUnit *cu, DWARFDeclContext &dwarf_decl_ctx) const { const dw_tag_t tag = Tag(); if (tag != DW_TAG_compile_unit) { @@ -1395,7 +1395,7 @@ } bool DWARFDebugInfoEntry::MatchesDWARFDeclContext( - SymbolFileDWARF *dwarf2Data, DWARFCompileUnit *cu, + SymbolFileDWARF *dwarf2Data, DWARFUnit *cu, const DWARFDeclContext &dwarf_decl_ctx) const { DWARFDeclContext this_dwarf_decl_ctx; @@ -1405,7 +1405,7 @@ DWARFDIE DWARFDebugInfoEntry::GetParentDeclContextDIE(SymbolFileDWARF *dwarf2Data, - DWARFCompileUnit *cu) const { + DWARFUnit *cu) const { DWARFAttributes attributes; GetAttributes(cu, DWARFFormValue::FixedFormSizes(), attributes); return GetParentDeclContextDIE(dwarf2Data, cu, attributes); @@ -1413,7 +1413,7 @@ DWARFDIE DWARFDebugInfoEntry::GetParentDeclContextDIE( - SymbolFileDWARF *dwarf2Data, DWARFCompileUnit *cu, + SymbolFileDWARF *dwarf2Data, DWARFUnit *cu, const DWARFAttributes &attributes) const { DWARFDIE die(cu, const_cast(this)); @@ -1465,7 +1465,7 @@ } const char *DWARFDebugInfoEntry::GetQualifiedName(SymbolFileDWARF *dwarf2Data, - DWARFCompileUnit *cu, + DWARFUnit *cu, std::string &storage) const { DWARFAttributes attributes; GetAttributes(cu, DWARFFormValue::FixedFormSizes(), attributes); @@ -1473,7 +1473,7 @@ } const char *DWARFDebugInfoEntry::GetQualifiedName( - SymbolFileDWARF *dwarf2Data, DWARFCompileUnit *cu, + SymbolFileDWARF *dwarf2Data, DWARFUnit *cu, const DWARFAttributes &attributes, std::string &storage) const { const char *name = GetName(dwarf2Data, cu); @@ -1529,7 +1529,7 @@ //---------------------------------------------------------------------- bool DWARFDebugInfoEntry::LookupAddress(const dw_addr_t address, SymbolFileDWARF *dwarf2Data, - const DWARFCompileUnit *cu, + const DWARFUnit *cu, DWARFDebugInfoEntry **function_die, DWARFDebugInfoEntry **block_die) { bool found_address = false; @@ -1772,7 +1772,7 @@ const DWARFAbbreviationDeclaration * DWARFDebugInfoEntry::GetAbbreviationDeclarationPtr( - SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, + SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, lldb::offset_t &offset) const { if (dwarf2Data) { offset = GetOffset(); Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h =================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h @@ -13,7 +13,7 @@ #include "DWARFDataExtractor.h" #include // for NULL -class DWARFCompileUnit; +class DWARFUnit; class DWARFFormValue { public: @@ -55,9 +55,9 @@ }; DWARFFormValue(); - DWARFFormValue(const DWARFCompileUnit *cu, dw_form_t form); - const DWARFCompileUnit *GetCompileUnit() const { return m_cu; } - void SetCompileUnit(const DWARFCompileUnit *cu) { m_cu = cu; } + DWARFFormValue(const DWARFUnit *cu, dw_form_t form); + const DWARFUnit *GetCompileUnit() const { return m_cu; } + void SetCompileUnit(const DWARFUnit *cu) { m_cu = cu; } dw_form_t Form() const { return m_form; } void SetForm(dw_form_t form) { m_form = form; } const ValueType &Value() const { return m_value; } @@ -79,7 +79,7 @@ lldb::offset_t *offset_ptr) const; static bool SkipValue(const dw_form_t form, const lldb_private::DWARFDataExtractor &debug_info_data, - lldb::offset_t *offset_ptr, const DWARFCompileUnit *cu); + lldb::offset_t *offset_ptr, const DWARFUnit *cu); static bool IsBlockForm(const dw_form_t form); static bool IsDataForm(const dw_form_t form); static FixedFormSizes GetFixedFormSizesForAddressSize(uint8_t addr_size, @@ -89,7 +89,7 @@ static bool FormIsSupported(dw_form_t form); protected: - const DWARFCompileUnit *m_cu; // Compile unit for this form + const DWARFUnit *m_cu; // Compile unit for this form dw_form_t m_form; // Form for this value ValueType m_value; // Contains all data for the form }; Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp =================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp @@ -12,10 +12,10 @@ #include "lldb/Core/dwarf.h" #include "lldb/Utility/Stream.h" -#include "DWARFCompileUnit.h" +#include "DWARFUnit.h" #include "DWARFFormValue.h" -class DWARFCompileUnit; +class DWARFUnit; using namespace lldb_private; @@ -154,7 +154,7 @@ DWARFFormValue::DWARFFormValue() : m_cu(NULL), m_form(0), m_value() {} -DWARFFormValue::DWARFFormValue(const DWARFCompileUnit *cu, dw_form_t form) +DWARFFormValue::DWARFFormValue(const DWARFUnit *cu, dw_form_t form) : m_cu(cu), m_form(form), m_value() {} void DWARFFormValue::Clear() { @@ -177,7 +177,7 @@ case DW_FORM_addr: assert(m_cu); m_value.value.uval = data.GetMaxU64( - offset_ptr, DWARFCompileUnit::GetAddressByteSize(m_cu)); + offset_ptr, DWARFUnit::GetAddressByteSize(m_cu)); break; case DW_FORM_block2: m_value.value.uval = data.GetU16(offset_ptr); @@ -220,7 +220,7 @@ case DW_FORM_strp: assert(m_cu); m_value.value.uval = - data.GetMaxU64(offset_ptr, DWARFCompileUnit::IsDWARF64(m_cu) ? 8 : 4); + data.GetMaxU64(offset_ptr, DWARFUnit::IsDWARF64(m_cu) ? 8 : 4); break; // case DW_FORM_APPLE_db_str: case DW_FORM_udata: @@ -258,7 +258,7 @@ case DW_FORM_sec_offset: assert(m_cu); m_value.value.uval = - data.GetMaxU64(offset_ptr, DWARFCompileUnit::IsDWARF64(m_cu) ? 8 : 4); + data.GetMaxU64(offset_ptr, DWARFUnit::IsDWARF64(m_cu) ? 8 : 4); break; case DW_FORM_flag_present: m_value.value.uval = 1; @@ -296,7 +296,7 @@ bool DWARFFormValue::SkipValue(dw_form_t form, const DWARFDataExtractor &debug_info_data, lldb::offset_t *offset_ptr, - const DWARFCompileUnit *cu) { + const DWARFUnit *cu) { uint8_t ref_addr_size; switch (form) { // Blocks if inlined data that have a length field and the data bytes @@ -330,7 +330,7 @@ // Compile unit address sized values case DW_FORM_addr: - *offset_ptr += DWARFCompileUnit::GetAddressByteSize(cu); + *offset_ptr += DWARFUnit::GetAddressByteSize(cu); return true; case DW_FORM_ref_addr: Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFUnit.h =================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFUnit.h +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFUnit.h @@ -31,6 +31,8 @@ }; class DWARFUnit { + friend class DWARFCompileUnit; + public: virtual ~DWARFUnit(); Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp =================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp @@ -154,7 +154,7 @@ Data().m_die_array.begin(), end, die_offset, CompareDIEOffset); if (pos != end) { if (die_offset == (*pos).GetOffset()) - return DWARFDIE(&Data(), &(*pos)); + return DWARFDIE(this, &(*pos)); } } else { // Don't specify the compile unit offset as we don't know it because the @@ -364,7 +364,7 @@ DWARFFormValue specification_die_form; const size_t num_attributes = - die.GetAttributes(&dwarf_cu->Data(), fixed_form_sizes, attributes); + die.GetAttributes(dwarf_cu, fixed_form_sizes, attributes); if (num_attributes > 0) { for (uint32_t i = 0; i < num_attributes; ++i) { dw_attr_t attr = attributes.AttributeAtIndex(i); Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h =================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h @@ -272,19 +272,19 @@ HasForwardDeclForClangType(const lldb_private::CompilerType &compiler_type); lldb_private::CompileUnit * - GetCompUnitForDWARFCompUnit(DWARFCompileUnit *dwarf_cu, + GetCompUnitForDWARFCompUnit(DWARFUnit *dwarf_cu, uint32_t cu_idx = UINT32_MAX); virtual size_t GetObjCMethodDIEOffsets(lldb_private::ConstString class_name, DIEArray &method_die_offsets); - bool Supports_DW_AT_APPLE_objc_complete_type(DWARFCompileUnit *cu); + bool Supports_DW_AT_APPLE_objc_complete_type(DWARFUnit *cu); lldb_private::DebugMacrosSP ParseDebugMacros(lldb::offset_t *offset); static DWARFDIE GetParentSymbolContextDIE(const DWARFDIE &die); - virtual lldb::CompUnitSP ParseCompileUnit(DWARFCompileUnit *dwarf_cu, + virtual lldb::CompUnitSP ParseCompileUnit(DWARFUnit *dwarf_cu, uint32_t cu_idx); virtual lldb_private::DWARFExpression::LocationListFormat @@ -303,13 +303,13 @@ virtual DWARFDIE GetDIE(const DIERef &die_ref); virtual std::unique_ptr - GetDwoSymbolFileForCompileUnit(DWARFCompileUnit &dwarf_cu, + GetDwoSymbolFileForCompileUnit(DWARFUnit &dwarf_cu, const DWARFDebugInfoEntry &cu_die); // For regular SymbolFileDWARF instances the method returns nullptr, // for the instances of the subclass SymbolFileDWARFDwo // the method returns a pointer to the base compile unit. - virtual DWARFCompileUnit *GetBaseCompileUnit(); + virtual DWARFUnit *GetBaseCompileUnit(); protected: typedef llvm::DenseMap @@ -342,10 +342,10 @@ DIEInDeclContext(const lldb_private::CompilerDeclContext *parent_decl_ctx, const DWARFDIE &die); - virtual DWARFCompileUnit * + virtual DWARFUnit * GetDWARFCompileUnit(lldb_private::CompileUnit *comp_unit); - DWARFCompileUnit *GetNextUnparsedDWARFCompileUnit(DWARFCompileUnit *prev_cu); + DWARFUnit *GetNextUnparsedDWARFCompileUnit(DWARFUnit *prev_cu); bool GetFunction(const DWARFDIE &die, lldb_private::SymbolContext &sc); Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp =================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -58,7 +58,7 @@ #include "DWARFASTParser.h" #include "DWARFASTParserClang.h" -#include "DWARFCompileUnit.h" +#include "DWARFUnit.h" #include "DWARFDIECollection.h" #include "DWARFDebugAbbrev.h" #include "DWARFDebugAranges.h" @@ -208,7 +208,7 @@ return nullptr; } -DWARFCompileUnit *SymbolFileDWARF::GetBaseCompileUnit() { +DWARFUnit *SymbolFileDWARF::GetBaseCompileUnit() { return nullptr; } @@ -333,7 +333,7 @@ TypeSet type_set; CompileUnit *comp_unit = NULL; - DWARFCompileUnit *dwarf_cu = NULL; + DWARFUnit *dwarf_cu = NULL; if (sc_scope) comp_unit = sc_scope->CalculateSymbolContextCompileUnit(); @@ -716,7 +716,7 @@ return m_info.get(); } -DWARFCompileUnit * +DWARFUnit * SymbolFileDWARF::GetDWARFCompileUnit(lldb_private::CompileUnit *comp_unit) { if (!comp_unit) return nullptr; @@ -726,7 +726,7 @@ // Just a normal DWARF file whose user ID for the compile unit is // the DWARF offset itself - DWARFCompileUnit *dwarf_cu = + DWARFUnit *dwarf_cu = info->GetCompileUnit((dw_offset_t)comp_unit->GetID()); if (dwarf_cu && dwarf_cu->GetUserData() == NULL) dwarf_cu->SetUserData(comp_unit); @@ -753,7 +753,7 @@ return m_ranges.get(); } -lldb::CompUnitSP SymbolFileDWARF::ParseCompileUnit(DWARFCompileUnit *dwarf_cu, +lldb::CompUnitSP SymbolFileDWARF::ParseCompileUnit(DWARFUnit *dwarf_cu, uint32_t cu_idx) { CompUnitSP cu_sp; if (dwarf_cu) { @@ -792,7 +792,7 @@ cu_file_spec.SetFile(remapped_file, false); } - LanguageType cu_language = DWARFCompileUnit::LanguageTypeFromDWARF( + LanguageType cu_language = DWARFUnit::LanguageTypeFromDWARF( cu_die.GetAttributeValueAsUnsigned(DW_AT_language, 0)); bool is_optimized = dwarf_cu->GetIsOptimized(); @@ -843,7 +843,7 @@ CompUnitSP cu_sp; DWARFDebugInfo *info = DebugInfo(); if (info) { - DWARFCompileUnit *dwarf_cu = info->GetCompileUnitAtIndex(cu_idx); + DWARFUnit *dwarf_cu = info->GetCompileUnitAtIndex(cu_idx); if (dwarf_cu) cu_sp = ParseCompileUnit(dwarf_cu, cu_idx); } @@ -876,7 +876,7 @@ lldb::LanguageType SymbolFileDWARF::ParseCompileUnitLanguage(const SymbolContext &sc) { assert(sc.comp_unit); - DWARFCompileUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit); + DWARFUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit); if (dwarf_cu) return dwarf_cu->GetLanguageType(); else @@ -886,7 +886,7 @@ size_t SymbolFileDWARF::ParseCompileUnitFunctions(const SymbolContext &sc) { assert(sc.comp_unit); size_t functions_added = 0; - DWARFCompileUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit); + DWARFUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit); if (dwarf_cu) { DWARFDIECollection function_dies; const size_t num_functions = @@ -907,7 +907,7 @@ bool SymbolFileDWARF::ParseCompileUnitSupportFiles( const SymbolContext &sc, FileSpecList &support_files) { assert(sc.comp_unit); - DWARFCompileUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit); + DWARFUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit); if (dwarf_cu) { const DWARFDIE cu_die = dwarf_cu->GetCompileUnitDIEOnly(); @@ -931,7 +931,7 @@ bool SymbolFileDWARF::ParseCompileUnitIsOptimized( const lldb_private::SymbolContext &sc) { - DWARFCompileUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit); + DWARFUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit); if (dwarf_cu) return dwarf_cu->GetIsOptimized(); return false; @@ -941,7 +941,7 @@ const lldb_private::SymbolContext &sc, std::vector &imported_modules) { assert(sc.comp_unit); - DWARFCompileUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit); + DWARFUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit); if (dwarf_cu) { if (ClangModulesDeclVendor::LanguageSupportsClangModules( sc.comp_unit->GetLanguage())) { @@ -1022,7 +1022,7 @@ if (sc.comp_unit->GetLineTable() != NULL) return true; - DWARFCompileUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit); + DWARFUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit); if (dwarf_cu) { const DWARFDIE dwarf_cu_die = dwarf_cu->GetCompileUnitDIEOnly(); if (dwarf_cu_die) { @@ -1105,7 +1105,7 @@ bool SymbolFileDWARF::ParseCompileUnitDebugMacros(const SymbolContext &sc) { assert(sc.comp_unit); - DWARFCompileUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit); + DWARFUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit); if (dwarf_cu == nullptr) return false; @@ -1494,7 +1494,7 @@ } CompileUnit * -SymbolFileDWARF::GetCompUnitForDWARFCompUnit(DWARFCompileUnit *dwarf_cu, +SymbolFileDWARF::GetCompUnitForDWARFCompUnit(DWARFUnit *dwarf_cu, uint32_t cu_idx) { // Check if the symbol vendor already knows about this compile unit? if (dwarf_cu->GetUserData() == NULL) { @@ -1561,7 +1561,7 @@ std::unique_ptr SymbolFileDWARF::GetDwoSymbolFileForCompileUnit( - DWARFCompileUnit &dwarf_cu, const DWARFDebugInfoEntry &cu_die) { + DWARFUnit &dwarf_cu, const DWARFDebugInfoEntry &cu_die) { // If we are using a dSYM file, we never want the standard DWO files since // the -gmodules support uses the same DWO machanism to specify full debug // info files for modules. @@ -1618,7 +1618,7 @@ const uint32_t num_compile_units = GetNumCompileUnits(); for (uint32_t cu_idx = 0; cu_idx < num_compile_units; ++cu_idx) { - DWARFCompileUnit *dwarf_cu = debug_info->GetCompileUnitAtIndex(cu_idx); + DWARFUnit *dwarf_cu = debug_info->GetCompileUnitAtIndex(cu_idx); const DWARFDIE die = dwarf_cu->GetCompileUnitDIEOnly(); if (die && die.HasChildren() == false) { @@ -1775,7 +1775,7 @@ } } else { uint32_t cu_idx = DW_INVALID_INDEX; - DWARFCompileUnit *dwarf_cu = + DWARFUnit *dwarf_cu = debug_info->GetCompileUnit(cu_offset, &cu_idx); if (dwarf_cu) { sc.comp_unit = GetCompUnitForDWARFCompUnit(dwarf_cu, cu_idx); @@ -1877,7 +1877,7 @@ DWARFDebugInfo *debug_info = DebugInfo(); if (debug_info) { uint32_t cu_idx; - DWARFCompileUnit *dwarf_cu = NULL; + DWARFUnit *dwarf_cu = NULL; for (cu_idx = 0; (dwarf_cu = debug_info->GetCompileUnitAtIndex(cu_idx)) != NULL; @@ -2024,7 +2024,7 @@ &function_selector_index, &objc_class_selectors_index, &global_index, &type_index, &namespace_index](size_t cu_idx) { - DWARFCompileUnit *dwarf_cu = debug_info->GetCompileUnitAtIndex(cu_idx); + DWARFUnit *dwarf_cu = debug_info->GetCompileUnitAtIndex(cu_idx); if (dwarf_cu) { dwarf_cu->Index( function_basename_index[cu_idx], function_fullname_index[cu_idx], @@ -2035,7 +2035,7 @@ }; auto extract_fn = [debug_info, &clear_cu_dies](size_t cu_idx) { - DWARFCompileUnit *dwarf_cu = debug_info->GetCompileUnitAtIndex(cu_idx); + DWARFUnit *dwarf_cu = debug_info->GetCompileUnitAtIndex(cu_idx); if (dwarf_cu) { // dwarf_cu->ExtractDIEsIfNeeded(false) will return zero if the // DIEs for a compile unit have already been parsed. @@ -2787,7 +2787,7 @@ num_comp_units = info->GetNumCompileUnits(); for (uint32_t i = 0; i < num_comp_units; i++) { - DWARFCompileUnit *cu = info->GetCompileUnitAtIndex(i); + DWARFUnit *cu = info->GetCompileUnitAtIndex(i); if (cu == nullptr) continue; @@ -3167,7 +3167,7 @@ // DWARF file // if we are doing darwin DWARF in .o file debugging. bool SymbolFileDWARF::Supports_DW_AT_APPLE_objc_complete_type( - DWARFCompileUnit *cu) { + DWARFUnit *cu) { if (m_supports_DW_AT_APPLE_objc_complete_type == eLazyBoolCalculate) { m_supports_DW_AT_APPLE_objc_complete_type = eLazyBoolNo; if (cu && cu->Supports_DW_AT_APPLE_objc_complete_type()) @@ -3176,7 +3176,7 @@ DWARFDebugInfo *debug_info = DebugInfo(); const uint32_t num_compile_units = GetNumCompileUnits(); for (uint32_t cu_idx = 0; cu_idx < num_compile_units; ++cu_idx) { - DWARFCompileUnit *dwarf_cu = debug_info->GetCompileUnitAtIndex(cu_idx); + DWARFUnit *dwarf_cu = debug_info->GetCompileUnitAtIndex(cu_idx); if (dwarf_cu != cu && dwarf_cu->Supports_DW_AT_APPLE_objc_complete_type()) { m_supports_DW_AT_APPLE_objc_complete_type = eLazyBoolYes; @@ -3604,7 +3604,7 @@ size_t SymbolFileDWARF::ParseFunctionBlocks(const SymbolContext &sc) { assert(sc.comp_unit && sc.function); size_t functions_added = 0; - DWARFCompileUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit); + DWARFUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit); if (dwarf_cu) { const dw_offset_t function_die_offset = sc.function->GetID(); DWARFDIE function_die = dwarf_cu->GetDIE(function_die_offset); @@ -3621,7 +3621,7 @@ // At least a compile unit must be valid assert(sc.comp_unit); size_t types_added = 0; - DWARFCompileUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit); + DWARFUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit); if (dwarf_cu) { if (sc.function) { dw_offset_t function_die_offset = sc.function->GetID(); @@ -3660,7 +3660,7 @@ return num_variables; } } else if (sc.comp_unit) { - DWARFCompileUnit *dwarf_cu = info->GetCompileUnit(sc.comp_unit->GetID()); + DWARFUnit *dwarf_cu = info->GetCompileUnit(sc.comp_unit->GetID()); if (dwarf_cu == NULL) return 0; Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h =================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h @@ -18,16 +18,16 @@ class SymbolFileDWARFDwo : public SymbolFileDWARF { public: - SymbolFileDWARFDwo(lldb::ObjectFileSP objfile, DWARFCompileUnit *dwarf_cu); + SymbolFileDWARFDwo(lldb::ObjectFileSP objfile, DWARFUnit *dwarf_cu); ~SymbolFileDWARFDwo() override = default; - lldb::CompUnitSP ParseCompileUnit(DWARFCompileUnit *dwarf_cu, + lldb::CompUnitSP ParseCompileUnit(DWARFUnit *dwarf_cu, uint32_t cu_idx) override; - DWARFCompileUnit *GetCompileUnit(); + DWARFUnit *GetCompileUnit(); - DWARFCompileUnit * + DWARFUnit * GetDWARFCompileUnit(lldb_private::CompileUnit *comp_unit) override; lldb_private::DWARFExpression::LocationListFormat @@ -43,12 +43,12 @@ GetDIE(const DIERef &die_ref) override; std::unique_ptr - GetDwoSymbolFileForCompileUnit(DWARFCompileUnit &dwarf_cu, + GetDwoSymbolFileForCompileUnit(DWARFUnit &dwarf_cu, const DWARFDebugInfoEntry &cu_die) override { return nullptr; } - DWARFCompileUnit *GetBaseCompileUnit() override; + DWARFUnit *GetBaseCompileUnit() override; protected: void LoadSectionData(lldb::SectionType sect_type, @@ -74,7 +74,7 @@ SymbolFileDWARF *GetBaseSymbolFile(); lldb::ObjectFileSP m_obj_file_sp; - DWARFCompileUnit *m_base_dwarf_cu; + DWARFUnit *m_base_dwarf_cu; }; #endif // SymbolFileDWARFDwo_SymbolFileDWARFDwo_h_ Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp =================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp @@ -14,14 +14,14 @@ #include "lldb/Symbol/ObjectFile.h" #include "lldb/Utility/LLDBAssert.h" -#include "DWARFCompileUnit.h" +#include "DWARFUnit.h" #include "DWARFDebugInfo.h" using namespace lldb; using namespace lldb_private; SymbolFileDWARFDwo::SymbolFileDWARFDwo(ObjectFileSP objfile, - DWARFCompileUnit *dwarf_cu) + DWARFUnit *dwarf_cu) : SymbolFileDWARF(objfile.get()), m_obj_file_sp(objfile), m_base_dwarf_cu(dwarf_cu) { SetID(((lldb::user_id_t)dwarf_cu->GetOffset()) << 32); @@ -52,7 +52,7 @@ } lldb::CompUnitSP -SymbolFileDWARFDwo::ParseCompileUnit(DWARFCompileUnit *dwarf_cu, +SymbolFileDWARFDwo::ParseCompileUnit(DWARFUnit *dwarf_cu, uint32_t cu_idx) { assert(GetCompileUnit() == dwarf_cu && "SymbolFileDWARFDwo::ParseCompileUnit " "called with incompatible compile " @@ -60,7 +60,7 @@ return GetBaseSymbolFile()->ParseCompileUnit(m_base_dwarf_cu, UINT32_MAX); } -DWARFCompileUnit *SymbolFileDWARFDwo::GetCompileUnit() { +DWARFUnit *SymbolFileDWARFDwo::GetCompileUnit() { // A clang module is found via a skeleton CU, but is not a proper DWO. // Clang modules have a .debug_info section instead of the *_dwo variant. if (auto *section_list = m_obj_file->GetSectionList(false)) @@ -76,7 +76,7 @@ return nullptr; } -DWARFCompileUnit * +DWARFUnit * SymbolFileDWARFDwo::GetDWARFCompileUnit(lldb_private::CompileUnit *comp_unit) { return GetCompileUnit(); } @@ -122,7 +122,7 @@ die, type_name, must_be_implementation); } -DWARFCompileUnit *SymbolFileDWARFDwo::GetBaseCompileUnit() { +DWARFUnit *SymbolFileDWARFDwo::GetBaseCompileUnit() { return m_base_dwarf_cu; } Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwoDwp.h =================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwoDwp.h +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwoDwp.h @@ -20,7 +20,7 @@ class SymbolFileDWARFDwoDwp : public SymbolFileDWARFDwo { public: SymbolFileDWARFDwoDwp(SymbolFileDWARFDwp *dwp_symfile, - lldb::ObjectFileSP objfile, DWARFCompileUnit *dwarf_cu, + lldb::ObjectFileSP objfile, DWARFUnit *dwarf_cu, uint64_t dwo_id); protected: Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwoDwp.cpp =================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwoDwp.cpp +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwoDwp.cpp @@ -14,7 +14,7 @@ #include "lldb/Symbol/ObjectFile.h" #include "lldb/Utility/LLDBAssert.h" -#include "DWARFCompileUnit.h" +#include "DWARFUnit.h" #include "DWARFDebugInfo.h" using namespace lldb; @@ -22,7 +22,7 @@ SymbolFileDWARFDwoDwp::SymbolFileDWARFDwoDwp(SymbolFileDWARFDwp *dwp_symfile, ObjectFileSP objfile, - DWARFCompileUnit *dwarf_cu, + DWARFUnit *dwarf_cu, uint64_t dwo_id) : SymbolFileDWARFDwo(objfile, dwarf_cu), m_dwp_symfile(dwp_symfile), m_dwo_id(dwo_id) {} Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwp.h =================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwp.h +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwp.h @@ -29,7 +29,7 @@ Create(lldb::ModuleSP module_sp, const lldb_private::FileSpec &file_spec); std::unique_ptr - GetSymbolFileForDwoId(DWARFCompileUnit *dwarf_cu, uint64_t dwo_id); + GetSymbolFileForDwoId(DWARFUnit *dwarf_cu, uint64_t dwo_id); bool LoadSectionData(uint64_t dwo_id, lldb::SectionType sect_type, lldb_private::DWARFDataExtractor &data); Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwp.cpp =================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwp.cpp +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwp.cpp @@ -85,7 +85,7 @@ {} std::unique_ptr -SymbolFileDWARFDwp::GetSymbolFileForDwoId(DWARFCompileUnit *dwarf_cu, +SymbolFileDWARFDwp::GetSymbolFileForDwoId(DWARFUnit *dwarf_cu, uint64_t dwo_id) { return std::unique_ptr( new SymbolFileDWARFDwoDwp(this, m_obj_file, dwarf_cu, dwo_id));