diff options
Diffstat (limited to 'lldb/source/Plugins/SymbolFile')
30 files changed, 0 insertions, 272 deletions
diff --git a/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.h b/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.h index 42bb1186437..2760a5a573e 100644 --- a/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.h +++ b/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.h @@ -20,9 +20,7 @@ namespace breakpad { class SymbolFileBreakpad : public SymbolFile { public: - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); static void DebuggerInitialize(Debugger &debugger) {} @@ -36,9 +34,7 @@ public: return new SymbolFileBreakpad(obj_file); } - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ SymbolFileBreakpad(ObjectFile *object_file) : SymbolFile(object_file) {} ~SymbolFileBreakpad() override {} @@ -47,9 +43,7 @@ public: void InitializeObject() override {} - //------------------------------------------------------------------ // Compile Unit function calls - //------------------------------------------------------------------ uint32_t GetNumCompileUnits() override; diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DIERef.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DIERef.cpp index 626d1a95b76..fd6f66b645e 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DIERef.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DIERef.cpp @@ -51,14 +51,12 @@ DIERef::DIERef(const DWARFFormValue &form_value) } lldb::user_id_t DIERef::GetUID(SymbolFileDWARF *dwarf) const { - //---------------------------------------------------------------------- // Each SymbolFileDWARF will set its ID to what is expected. // // SymbolFileDWARF, when used for DWARF with .o files on MacOSX, has the // ID set to the compile unit index. // // SymbolFileDWARFDwo sets the ID to the compile unit offset. - //---------------------------------------------------------------------- if (dwarf && die_offset != DW_INVALID_OFFSET) return dwarf->GetID() | die_offset; else diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DIERef.h b/lldb/source/Plugins/SymbolFile/DWARF/DIERef.h index a867a5f41d1..b2bb4de2ecc 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DIERef.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DIERef.h @@ -20,22 +20,18 @@ struct DIERef { DIERef(dw_offset_t c, dw_offset_t d) : cu_offset(c), die_offset(d) {} - //---------------------------------------------------------------------- // In order to properly decode a lldb::user_id_t back into a DIERef we // need the DWARF file since it knows if DWARF in .o files is being used // (MacOSX) or if DWO files are being used. The encoding of the user ID // differs between the two types of DWARF. - //---------------------------------------------------------------------- explicit DIERef(lldb::user_id_t uid, SymbolFileDWARF *dwarf); explicit DIERef(const DWARFFormValue &form_value); - //---------------------------------------------------------------------- // In order to properly encode a DIERef unto a lldb::user_id_t we need // the DWARF file since it knows if DWARF in .o files is being used // (MacOSX) or if DWO files are being used. The encoding of the user ID // differs between the two types of DWARF. - //---------------------------------------------------------------------- lldb::user_id_t GetUID(SymbolFileDWARF *dwarf) const; bool operator<(const DIERef &ref) const { diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp index 63617c286eb..360c1249f87 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp @@ -2115,7 +2115,6 @@ bool DWARFASTParserClang::CompleteTypeFromDWARF(const DWARFDIE &die, return false; #if defined LLDB_CONFIGURATION_DEBUG - //---------------------------------------------------------------------- // For debugging purposes, the LLDB_DWARF_DONT_COMPLETE_TYPENAMES environment // variable can be set with one or more typenames separated by ';' // characters. This will cause this function to not complete any types whose @@ -2125,7 +2124,6 @@ bool DWARFASTParserClang::CompleteTypeFromDWARF(const DWARFDIE &die, // // LLDB_DWARF_DONT_COMPLETE_TYPENAMES=Foo // LLDB_DWARF_DONT_COMPLETE_TYPENAMES=Foo;Bar;Baz - //---------------------------------------------------------------------- const char *dont_complete_typenames_cstr = getenv("LLDB_DWARF_DONT_COMPLETE_TYPENAMES"); if (dont_complete_typenames_cstr && dont_complete_typenames_cstr[0]) { diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h index 38cd0bf38a1..e561ac5b3b8 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h @@ -128,10 +128,8 @@ protected: lldb::TypeSP ParseTypeFromDWO(const DWARFDIE &die, lldb_private::Log *log); - //---------------------------------------------------------------------- // Return true if this type is a declaration to a type in an external // module. - //---------------------------------------------------------------------- lldb::ModuleSP GetModuleForType(const DWARFDIE &die); typedef llvm::SmallPtrSet<const DWARFDebugInfoEntry *, 4> DIEPointerSet; diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.h index 486572a4c80..278c2b6188b 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.h @@ -37,9 +37,7 @@ public: : m_cu(const_cast<DWARFUnit *>(cu)), m_die(const_cast<DWARFDebugInfoEntry *>(die)) {} - //---------------------------------------------------------------------- // Tests - //---------------------------------------------------------------------- explicit operator bool() const { return IsValid(); } bool IsValid() const { return m_cu && m_die; } @@ -48,9 +46,7 @@ public: bool Supports_DW_AT_APPLE_objc_complete_type() const; - //---------------------------------------------------------------------- // Accessors - //---------------------------------------------------------------------- SymbolFileDWARF *GetDWARF() const; DWARFUnit *GetCU() const { return m_cu; } @@ -77,31 +73,25 @@ public: m_die = nullptr; } - //---------------------------------------------------------------------- // Get the data that contains the attribute values for this DIE. Support // for .debug_types means that any DIE can have its data either in the // .debug_info or the .debug_types section; this method will return the // correct section data. // // Clients must validate that this object is valid before calling this. - //---------------------------------------------------------------------- const lldb_private::DWARFDataExtractor &GetData() const; - //---------------------------------------------------------------------- // Accessing information about a DIE - //---------------------------------------------------------------------- dw_tag_t Tag() const; const char *GetTagAsCString() const; dw_offset_t GetOffset() const; - //---------------------------------------------------------------------- // Get the LLDB user ID for this DIE. This is often just the DIE offset, // but it might have a SymbolFileDWARF::GetID() in the high 32 bits if // we are doing Darwin DWARF in .o file, or DWARF stand alone debug // info. - //---------------------------------------------------------------------- lldb::user_id_t GetID() const; const char *GetName() const; @@ -112,13 +102,11 @@ public: lldb_private::CompileUnit *GetLLDBCompileUnit() const; - //---------------------------------------------------------------------- // Getting attribute values from the DIE. // // GetAttributeValueAsXXX() functions should only be used if you are // looking for one or two attributes on a DIE. If you are trying to // parse all attributes, use GetAttributes (...) instead - //---------------------------------------------------------------------- const char *GetAttributeValueAsString(const dw_attr_t attr, const char *fail_value) const; diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h index dce99fbcbd9..b191ecb5fbb 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h @@ -20,22 +20,18 @@ public: lldb::offset_t *offset_ptr); void Dump(lldb_private::Stream *s) const override; - //------------------------------------------------------------------ /// Get the data that contains the DIE information for this unit. /// /// \return /// The correct data (.debug_types for DWARF 4 and earlier, and /// .debug_info for DWARF 5 and later) for the DIE information in /// this unit. - //------------------------------------------------------------------ const lldb_private::DWARFDataExtractor &GetData() const override; - //------------------------------------------------------------------ /// Get the size in bytes of the header. /// /// \return /// Byte size of the compile unit header - //------------------------------------------------------------------ uint32_t GetHeaderByteSize() const override; private: diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.h index af3323efe9f..854e05493d5 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.h @@ -16,24 +16,18 @@ class DWARFDIE : public DWARFBaseDIE { public: using DWARFBaseDIE::DWARFBaseDIE; - //---------------------------------------------------------------------- // Tests - //---------------------------------------------------------------------- bool IsStructUnionOrClass() const; bool IsMethod() const; - //---------------------------------------------------------------------- // Accessors - //---------------------------------------------------------------------- lldb::ModuleSP GetContainingDWOModule() const; DWARFDIE GetContainingDWOModuleDIE() const; - //---------------------------------------------------------------------- // Accessing information about a DIE - //---------------------------------------------------------------------- const char *GetMangledName() const; const char *GetPubname() const; @@ -42,14 +36,10 @@ public: lldb_private::Type *ResolveType() const; - //---------------------------------------------------------------------- // Resolve a type by UID using this DIE's DWARF file - //---------------------------------------------------------------------- lldb_private::Type *ResolveTypeUID(const DIERef &die_ref) const; - //---------------------------------------------------------------------- // Functions for obtaining DIE relations and references - //---------------------------------------------------------------------- DWARFDIE GetParent() const; @@ -63,11 +53,9 @@ public: DWARFDIE GetReferencedDIE(const dw_attr_t attr) const; - //---------------------------------------------------------------------- // Get a another DIE from the same DWARF file as this DIE. This will // check the current DIE's compile unit first to see if "die_offset" is // in the same compile unit, and fall back to checking the DWARF file. - //---------------------------------------------------------------------- DWARFDIE GetDIE(dw_offset_t die_offset) const; using DWARFBaseDIE::GetDIE; @@ -78,9 +66,7 @@ public: DWARFDIE GetParentDeclContextDIE() const; - //---------------------------------------------------------------------- // DeclContext related functions - //---------------------------------------------------------------------- std::vector<DWARFDIE> GetDeclContextDIEs() const; void GetDWARFDeclContext(DWARFDeclContext &dwarf_decl_ctx) const; @@ -90,13 +76,11 @@ public: void GetDeclContext(std::vector<lldb_private::CompilerContext> &context) const; - //---------------------------------------------------------------------- // Getting attribute values from the DIE. // // GetAttributeValueAsXXX() functions should only be used if you are // looking for one or two attributes on a DIE. If you are trying to // parse all attributes, use GetAttributes (...) instead - //---------------------------------------------------------------------- DWARFDIE GetAttributeValueAsReferenceDIE(const dw_attr_t attr) const; @@ -106,9 +90,7 @@ public: int &call_line, int &call_column, lldb_private::DWARFExpression *frame_base) const; - //---------------------------------------------------------------------- // CompilerDecl related functions - //---------------------------------------------------------------------- lldb_private::CompilerDecl GetDecl() const; diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp index 17a55a26611..25d64d4f62f 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp @@ -14,17 +14,13 @@ using namespace lldb; using namespace lldb_private; using namespace std; -//---------------------------------------------------------------------- // DWARFAbbreviationDeclarationSet::Clear() -//---------------------------------------------------------------------- void DWARFAbbreviationDeclarationSet::Clear() { m_idx_offset = 0; m_decls.clear(); } -//---------------------------------------------------------------------- // DWARFAbbreviationDeclarationSet::Extract() -//---------------------------------------------------------------------- llvm::Error DWARFAbbreviationDeclarationSet::extract(const DWARFDataExtractor &data, lldb::offset_t *offset_ptr) { @@ -54,9 +50,7 @@ DWARFAbbreviationDeclarationSet::extract(const DWARFDataExtractor &data, return llvm::ErrorSuccess(); } -//---------------------------------------------------------------------- // DWARFAbbreviationDeclarationSet::GetAbbreviationDeclaration() -//---------------------------------------------------------------------- const DWARFAbbreviationDeclaration * DWARFAbbreviationDeclarationSet::GetAbbreviationDeclaration( dw_uleb128_t abbrCode) const { @@ -76,9 +70,7 @@ DWARFAbbreviationDeclarationSet::GetAbbreviationDeclaration( } -//---------------------------------------------------------------------- // DWARFAbbreviationDeclarationSet::GetUnsupportedForms() -//---------------------------------------------------------------------- void DWARFAbbreviationDeclarationSet::GetUnsupportedForms( std::set<dw_form_t> &invalid_forms) const { for (const auto &abbr_decl : m_decls) { @@ -91,13 +83,11 @@ void DWARFAbbreviationDeclarationSet::GetUnsupportedForms( } } -//---------------------------------------------------------------------- // Encode // // Encode the abbreviation table onto the end of the buffer provided into a // byte representation as would be found in a ".debug_abbrev" debug information // section. -//---------------------------------------------------------------------- // void // DWARFAbbreviationDeclarationSet::Encode(BinaryStreamBuf& debug_abbrev_buf) // const @@ -109,15 +99,11 @@ void DWARFAbbreviationDeclarationSet::GetUnsupportedForms( // debug_abbrev_buf.Append8(0); //} -//---------------------------------------------------------------------- // DWARFDebugAbbrev constructor -//---------------------------------------------------------------------- DWARFDebugAbbrev::DWARFDebugAbbrev() : m_abbrevCollMap(), m_prev_abbr_offset_pos(m_abbrevCollMap.end()) {} -//---------------------------------------------------------------------- // DWARFDebugAbbrev::Parse() -//---------------------------------------------------------------------- llvm::Error DWARFDebugAbbrev::parse(const DWARFDataExtractor &data) { lldb::offset_t offset = 0; @@ -135,9 +121,7 @@ llvm::Error DWARFDebugAbbrev::parse(const DWARFDataExtractor &data) { return llvm::ErrorSuccess(); } -//---------------------------------------------------------------------- // DWARFDebugAbbrev::GetAbbreviationDeclarationSet() -//---------------------------------------------------------------------- const DWARFAbbreviationDeclarationSet * DWARFDebugAbbrev::GetAbbreviationDeclarationSet( dw_offset_t cu_abbr_offset) const { @@ -156,9 +140,7 @@ DWARFDebugAbbrev::GetAbbreviationDeclarationSet( return NULL; } -//---------------------------------------------------------------------- // DWARFDebugAbbrev::GetUnsupportedForms() -//---------------------------------------------------------------------- void DWARFDebugAbbrev::GetUnsupportedForms( std::set<dw_form_t> &invalid_forms) const { for (const auto &pair : m_abbrevCollMap) diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp index f00b97c7b52..fcacf59d8b8 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp @@ -24,14 +24,10 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // Constructor -//---------------------------------------------------------------------- DWARFDebugAranges::DWARFDebugAranges() : m_aranges() {} -//---------------------------------------------------------------------- // CountArangeDescriptors -//---------------------------------------------------------------------- class CountArangeDescriptors { public: CountArangeDescriptors(uint32_t &count_ref) : count(count_ref) { @@ -43,9 +39,7 @@ public: uint32_t &count; }; -//---------------------------------------------------------------------- // Extract -//---------------------------------------------------------------------- llvm::Error DWARFDebugAranges::extract(const DWARFDataExtractor &debug_aranges_data) { assert(debug_aranges_data.ValidOffset(0)); @@ -103,9 +97,7 @@ void DWARFDebugAranges::Sort(bool minimize) { m_aranges.CombineConsecutiveEntriesWithEqualData(); } -//---------------------------------------------------------------------- // FindAddress -//---------------------------------------------------------------------- dw_offset_t DWARFDebugAranges::FindAddress(dw_addr_t address) const { const RangeToDIE::Entry *entry = m_aranges.FindEntryThatContains(address); if (entry) diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp index 9f235ffad6c..a85e621a7a2 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp @@ -27,16 +27,12 @@ using namespace lldb; using namespace lldb_private; using namespace std; -//---------------------------------------------------------------------- // Constructor -//---------------------------------------------------------------------- DWARFDebugInfo::DWARFDebugInfo(lldb_private::DWARFContext &context) : m_dwarf2Data(NULL), m_context(context), m_compile_units(), m_cu_aranges_up() {} -//---------------------------------------------------------------------- // SetDwarfData -//---------------------------------------------------------------------- void DWARFDebugInfo::SetDwarfData(SymbolFileDWARF *dwarf2Data) { m_dwarf2Data = dwarf2Data; m_compile_units.clear(); @@ -201,11 +197,9 @@ DWARFDebugInfo::GetDIEForDIEOffset(dw_offset_t die_offset) { return DWARFDIE(); } -//---------------------------------------------------------------------- // GetDIE() // // Get the DIE (Debug Information Entry) with the specified offset. -//---------------------------------------------------------------------- DWARFDIE DWARFDebugInfo::GetDIE(const DIERef &die_ref) { DWARFUnit *cu = GetCompileUnit(die_ref); diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h index a29e3b17a75..4c8e0700743 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h @@ -62,9 +62,7 @@ protected: typedef std::vector<DWARFUnitSP> CompileUnitColl; - //---------------------------------------------------------------------- // Member variables - //---------------------------------------------------------------------- SymbolFileDWARF *m_dwarf2Data; lldb_private::DWARFContext &m_context; CompileUnitColl m_compile_units; diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp index 5de245d657f..13b539955ac 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp @@ -199,13 +199,11 @@ bool DWARFDebugInfoEntry::FastExtract( return false; } -//---------------------------------------------------------------------- // Extract // // Extract a debug info entry for a given compile unit from the .debug_info and // .debug_abbrev data within the SymbolFileDWARF class starting at the given // offset -//---------------------------------------------------------------------- bool DWARFDebugInfoEntry::Extract(const DWARFUnit *cu, lldb::offset_t *offset_ptr) { const DWARFDataExtractor &debug_info_data = cu->GetData(); @@ -370,12 +368,10 @@ static dw_offset_t GetRangesOffset(const DWARFDebugRangesBase *debug_ranges, return form_value.Unsigned(); } -//---------------------------------------------------------------------- // GetDIENamesAndRanges // // Gets the valid address ranges for a given DIE by looking for a // DW_AT_low_pc/DW_AT_high_pc pair, DW_AT_entry_pc, or DW_AT_ranges attributes. -//---------------------------------------------------------------------- bool DWARFDebugInfoEntry::GetDIENamesAndRanges( SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, const char *&name, const char *&mangled, DWARFRangeList &ranges, int &decl_file, @@ -572,12 +568,10 @@ bool DWARFDebugInfoEntry::GetDIENamesAndRanges( return !ranges.IsEmpty(); } -//---------------------------------------------------------------------- // Dump // // Dumps a debug information entry and all of it's attributes to the specified // stream. -//---------------------------------------------------------------------- void DWARFDebugInfoEntry::Dump(SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, Stream &s, uint32_t recurse_depth) const { @@ -630,13 +624,11 @@ void DWARFDebugInfoEntry::Dump(SymbolFileDWARF *dwarf2Data, } } -//---------------------------------------------------------------------- // DumpAttribute // // Dumps a debug information entry attribute along with it's form. Any special // display of attributes is done (disassemble location lists, show enumeration // values for attributes, etc). -//---------------------------------------------------------------------- void DWARFDebugInfoEntry::DumpAttribute( SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, const DWARFDataExtractor &debug_info_data, lldb::offset_t *offset_ptr, @@ -731,12 +723,10 @@ void DWARFDebugInfoEntry::DumpAttribute( s.PutCString(" )\n"); } -//---------------------------------------------------------------------- // Get all attribute values for a given DIE, including following any // specification or abstract origin attributes and including those in the // results. Any duplicate attributes will have the first instance take // precedence (this can happen for declaration attributes). -//---------------------------------------------------------------------- size_t DWARFDebugInfoEntry::GetAttributes( const DWARFUnit *cu, DWARFFormValue::FixedFormSizes fixed_form_sizes, DWARFAttributes &attributes, uint32_t curr_depth) const { @@ -809,14 +799,12 @@ size_t DWARFDebugInfoEntry::GetAttributes( return attributes.Size(); } -//---------------------------------------------------------------------- // GetAttributeValue // // Get the value of an attribute and return the .debug_info offset of the // attribute if it was properly extracted into form_value, or zero if we fail // since an offset of zero is invalid for an attribute (it would be a compile // unit header). -//---------------------------------------------------------------------- dw_offset_t DWARFDebugInfoEntry::GetAttributeValue( SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, const dw_attr_t attr, DWARFFormValue &form_value, @@ -897,14 +885,12 @@ dw_offset_t DWARFDebugInfoEntry::GetAttributeValue( check_specification_or_abstract_origin); } -//---------------------------------------------------------------------- // GetAttributeValueAsString // // Get the value of an attribute as a string return it. The resulting pointer // to the string data exists within the supplied SymbolFileDWARF and will only // be available as long as the SymbolFileDWARF is still around and it's content // doesn't change. -//---------------------------------------------------------------------- const char *DWARFDebugInfoEntry::GetAttributeValueAsString( SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, const dw_attr_t attr, const char *fail_value, @@ -916,11 +902,9 @@ const char *DWARFDebugInfoEntry::GetAttributeValueAsString( return fail_value; } -//---------------------------------------------------------------------- // GetAttributeValueAsUnsigned // // Get the value of an attribute as unsigned and return it. -//---------------------------------------------------------------------- uint64_t DWARFDebugInfoEntry::GetAttributeValueAsUnsigned( SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, const dw_attr_t attr, uint64_t fail_value, @@ -932,12 +916,10 @@ uint64_t DWARFDebugInfoEntry::GetAttributeValueAsUnsigned( return fail_value; } -//---------------------------------------------------------------------- // GetAttributeValueAsReference // // Get the value of an attribute as reference and fix up and compile unit // relative offsets as needed. -//---------------------------------------------------------------------- uint64_t DWARFDebugInfoEntry::GetAttributeValueAsReference( SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, const dw_attr_t attr, uint64_t fail_value, @@ -960,14 +942,12 @@ uint64_t DWARFDebugInfoEntry::GetAttributeValueAsAddress( return fail_value; } -//---------------------------------------------------------------------- // GetAttributeHighPC // // Get the hi_pc, adding hi_pc to lo_pc when specified as an <offset-from-low- // pc>. // // Returns the hi_pc or fail_value. -//---------------------------------------------------------------------- dw_addr_t DWARFDebugInfoEntry::GetAttributeHighPC( SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, dw_addr_t lo_pc, uint64_t fail_value, bool check_specification_or_abstract_origin) const { @@ -985,14 +965,12 @@ dw_addr_t DWARFDebugInfoEntry::GetAttributeHighPC( return fail_value; } -//---------------------------------------------------------------------- // GetAttributeAddressRange // // Get the lo_pc and hi_pc, adding hi_pc to lo_pc when specified as an <offset- // from-low-pc>. // // Returns true or sets lo_pc and hi_pc to fail_value. -//---------------------------------------------------------------------- bool DWARFDebugInfoEntry::GetAttributeAddressRange( SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, dw_addr_t &lo_pc, dw_addr_t &hi_pc, uint64_t fail_value, @@ -1034,23 +1012,19 @@ size_t DWARFDebugInfoEntry::GetAttributeAddressRanges( return ranges.GetSize(); } -//---------------------------------------------------------------------- // GetName // // Get value of the DW_AT_name attribute and return it if one exists, else // return NULL. -//---------------------------------------------------------------------- const char *DWARFDebugInfoEntry::GetName(SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu) const { return GetAttributeValueAsString(dwarf2Data, cu, DW_AT_name, nullptr, true); } -//---------------------------------------------------------------------- // GetMangledName // // Get value of the DW_AT_MIPS_linkage_name attribute and return it if one // exists, else return the value of the DW_AT_name attribute -//---------------------------------------------------------------------- const char * DWARFDebugInfoEntry::GetMangledName(SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, @@ -1074,12 +1048,10 @@ DWARFDebugInfoEntry::GetMangledName(SymbolFileDWARF *dwarf2Data, return name; } -//---------------------------------------------------------------------- // GetPubname // // Get value the name for a DIE as it should appear for a .debug_pubnames or // .debug_pubtypes section. -//---------------------------------------------------------------------- const char *DWARFDebugInfoEntry::GetPubname(SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu) const { const char *name = nullptr; @@ -1100,14 +1072,12 @@ const char *DWARFDebugInfoEntry::GetPubname(SymbolFileDWARF *dwarf2Data, return name; } -//---------------------------------------------------------------------- // GetName // // Get value of the DW_AT_name attribute for a debug information entry that // exists at offset "die_offset" and place that value into the supplied stream // object. If the DIE is a NULL object "NULL" is placed into the stream, and if // no DW_AT_name attribute exists for the DIE then nothing is printed. -//---------------------------------------------------------------------- bool DWARFDebugInfoEntry::GetName(SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, const dw_offset_t die_offset, Stream &s) { @@ -1134,13 +1104,11 @@ bool DWARFDebugInfoEntry::GetName(SymbolFileDWARF *dwarf2Data, return false; } -//---------------------------------------------------------------------- // AppendTypeName // // Follows the type name definition down through all needed tags to end up with // a fully qualified type name and dump the results to the supplied stream. // This is used to show the name of types given a type identifier. -//---------------------------------------------------------------------- bool DWARFDebugInfoEntry::AppendTypeName(SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, const dw_offset_t die_offset, @@ -1266,9 +1234,7 @@ bool DWARFDebugInfoEntry::AppendTypeName(SymbolFileDWARF *dwarf2Data, return false; } -//---------------------------------------------------------------------- // BuildAddressRangeTable -//---------------------------------------------------------------------- void DWARFDebugInfoEntry::BuildAddressRangeTable( SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, DWARFDebugAranges *debug_aranges) const { @@ -1292,14 +1258,12 @@ void DWARFDebugInfoEntry::BuildAddressRangeTable( } } -//---------------------------------------------------------------------- // BuildFunctionAddressRangeTable // // This function is very similar to the BuildAddressRangeTable function except // that the actual DIE offset for the function is placed in the table instead // of the compile unit offset (which is the way the standard .debug_aranges // section does it). -//---------------------------------------------------------------------- void DWARFDebugInfoEntry::BuildFunctionAddressRangeTable( SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, DWARFDebugAranges *debug_aranges) const { @@ -1478,9 +1442,7 @@ const char *DWARFDebugInfoEntry::GetQualifiedName( return storage.c_str(); } -//---------------------------------------------------------------------- // LookupAddress -//---------------------------------------------------------------------- bool DWARFDebugInfoEntry::LookupAddress(const dw_addr_t address, SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp index aae0b51c1b1..0a7a44ac282 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp @@ -27,12 +27,10 @@ using namespace lldb; using namespace lldb_private; using namespace std; -//---------------------------------------------------------------------- // Parse // // Parse all information in the debug_line_data into an internal // representation. -//---------------------------------------------------------------------- void DWARFDebugLine::Parse(const DWARFDataExtractor &debug_line_data) { m_lineTableMap.clear(); lldb::offset_t offset = 0; @@ -61,9 +59,7 @@ void DWARFDebugLine::ParseIfNeeded(const DWARFDataExtractor &debug_line_data) { Parse(debug_line_data); } -//---------------------------------------------------------------------- // DWARFDebugLine::GetLineTable -//---------------------------------------------------------------------- DWARFDebugLine::LineTable::shared_ptr DWARFDebugLine::GetLineTable(const dw_offset_t offset) const { DWARFDebugLine::LineTable::shared_ptr line_table_shared_ptr; @@ -73,13 +69,11 @@ DWARFDebugLine::GetLineTable(const dw_offset_t offset) const { return line_table_shared_ptr; } -//---------------------------------------------------------------------- // Parse // // Parse the entire line table contents calling callback each time a new // prologue is parsed and every time a new row is to be added to the line // table. -//---------------------------------------------------------------------- void DWARFDebugLine::Parse(const DWARFDataExtractor &debug_line_data, DWARFDebugLine::State::Callback callback, void *userData) { @@ -111,9 +105,7 @@ ReadDescriptors(const DWARFDataExtractor &debug_line_data, } } // namespace -//---------------------------------------------------------------------- // DWARFDebugLine::ParsePrologue -//---------------------------------------------------------------------- bool DWARFDebugLine::ParsePrologue(const DWARFDataExtractor &debug_line_data, lldb::offset_t *offset_ptr, Prologue *prologue, DWARFUnit *dwarf_cu) { @@ -273,13 +265,11 @@ bool DWARFDebugLine::ParseSupportFiles( return true; } -//---------------------------------------------------------------------- // ParseStatementTable // // Parse a single line table (prologue and all rows) and call the callback // function once for the prologue (row in state will be zero) and each time a // row is to be added to the line table. -//---------------------------------------------------------------------- bool DWARFDebugLine::ParseStatementTable( const DWARFDataExtractor &debug_line_data, lldb::offset_t *offset_ptr, DWARFDebugLine::State::Callback callback, void *userData, DWARFUnit *dwarf_cu) { @@ -552,9 +542,7 @@ bool DWARFDebugLine::ParseStatementTable( return end_offset; } -//---------------------------------------------------------------------- // ParseStatementTableCallback -//---------------------------------------------------------------------- static void ParseStatementTableCallback(dw_offset_t offset, const DWARFDebugLine::State &state, void *userData) { @@ -571,12 +559,10 @@ static void ParseStatementTableCallback(dw_offset_t offset, } } -//---------------------------------------------------------------------- // ParseStatementTable // // Parse a line table at offset and populate the LineTable class with the // prologue and all rows. -//---------------------------------------------------------------------- bool DWARFDebugLine::ParseStatementTable( const DWARFDataExtractor &debug_line_data, lldb::offset_t *offset_ptr, LineTable *line_table, DWARFUnit *dwarf_cu) { @@ -588,9 +574,7 @@ inline bool DWARFDebugLine::Prologue::IsValid() const { return SymbolFileDWARF::SupportedVersion(version); } -//---------------------------------------------------------------------- // DWARFDebugLine::Prologue::Dump -//---------------------------------------------------------------------- void DWARFDebugLine::Prologue::Dump(Log *log) { uint32_t i; @@ -629,11 +613,9 @@ void DWARFDebugLine::Prologue::Dump(Log *log) { } } -//---------------------------------------------------------------------- // DWARFDebugLine::ParsePrologue::Append // // Append the contents of the prologue to the binary stream buffer -//---------------------------------------------------------------------- // void // DWARFDebugLine::Prologue::Append(BinaryStreamBuf& buff) const //{ @@ -695,18 +677,14 @@ void DWARFDebugLine::LineTable::AppendRow(const DWARFDebugLine::Row &state) { rows.push_back(state); } -//---------------------------------------------------------------------- // Compare function for the binary search in // DWARFDebugLine::LineTable::LookupAddress() -//---------------------------------------------------------------------- static bool FindMatchingAddress(const DWARFDebugLine::Row &row1, const DWARFDebugLine::Row &row2) { return row1.address < row2.address; } -//---------------------------------------------------------------------- // DWARFDebugLine::LineTable::LookupAddress -//---------------------------------------------------------------------- uint32_t DWARFDebugLine::LineTable::LookupAddress(dw_addr_t address, dw_addr_t cu_high_pc) const { uint32_t index = UINT32_MAX; @@ -739,26 +717,20 @@ uint32_t DWARFDebugLine::LineTable::LookupAddress(dw_addr_t address, return index; // Failed to find address } -//---------------------------------------------------------------------- // DWARFDebugLine::Row::Row -//---------------------------------------------------------------------- DWARFDebugLine::Row::Row(bool default_is_stmt) : address(0), line(1), column(0), file(1), is_stmt(default_is_stmt), basic_block(false), end_sequence(false), prologue_end(false), epilogue_begin(false), isa(0) {} -//---------------------------------------------------------------------- // Called after a row is appended to the matrix -//---------------------------------------------------------------------- void DWARFDebugLine::Row::PostAppend() { basic_block = false; prologue_end = false; epilogue_begin = false; } -//---------------------------------------------------------------------- // DWARFDebugLine::Row::Reset -//---------------------------------------------------------------------- void DWARFDebugLine::Row::Reset(bool default_is_stmt) { address = 0; line = 1; @@ -771,9 +743,7 @@ void DWARFDebugLine::Row::Reset(bool default_is_stmt) { epilogue_begin = false; isa = 0; } -//---------------------------------------------------------------------- // DWARFDebugLine::Row::Dump -//---------------------------------------------------------------------- void DWARFDebugLine::Row::Dump(Log *log) const { log->Printf("0x%16.16" PRIx64 " %6u %6u %6u %3u %s%s%s%s%s", address, line, column, file, isa, is_stmt ? " is_stmt" : "", @@ -783,9 +753,7 @@ void DWARFDebugLine::Row::Dump(Log *log) const { end_sequence ? " end_sequence" : ""); } -//---------------------------------------------------------------------- // Compare function LineTable structures -//---------------------------------------------------------------------- static bool AddressLessThan(const DWARFDebugLine::Row &a, const DWARFDebugLine::Row &b) { return a.address < b.address; @@ -825,9 +793,7 @@ void DWARFDebugLine::Row::Insert(Row::collection &state_coll, } } -//---------------------------------------------------------------------- // DWARFDebugLine::State::State -//---------------------------------------------------------------------- DWARFDebugLine::State::State(Prologue::shared_ptr &p, Log *l, DWARFDebugLine::State::Callback cb, void *userData) : Row(p->default_is_stmt), prologue(p), log(l), callback(cb), @@ -837,14 +803,10 @@ DWARFDebugLine::State::State(Prologue::shared_ptr &p, Log *l, callback(0, *this, callbackUserData); } -//---------------------------------------------------------------------- // DWARFDebugLine::State::Reset -//---------------------------------------------------------------------- void DWARFDebugLine::State::Reset() { Row::Reset(prologue->default_is_stmt); } -//---------------------------------------------------------------------- // DWARFDebugLine::State::AppendRowToMatrix -//---------------------------------------------------------------------- void DWARFDebugLine::State::AppendRowToMatrix(dw_offset_t offset) { // Each time we are to add an entry into the line table matrix call the // callback function so that someone can do something with the current state @@ -864,9 +826,7 @@ void DWARFDebugLine::State::AppendRowToMatrix(dw_offset_t offset) { PostAppend(); } -//---------------------------------------------------------------------- // DWARFDebugLine::State::Finalize -//---------------------------------------------------------------------- void DWARFDebugLine::State::Finalize(dw_offset_t offset) { // Call the callback with a special row state when we are done parsing a line // table diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h index 4c4e0d33c6c..9dc2d9b40df 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h @@ -24,14 +24,10 @@ class DWARFUnit; class SymbolFileDWARF; -//---------------------------------------------------------------------- // DWARFDebugLine -//---------------------------------------------------------------------- class DWARFDebugLine { public: - //------------------------------------------------------------------ // FileNameEntry - //------------------------------------------------------------------ struct FileNameEntry { FileNameEntry() : name(nullptr), dir_idx(0), mod_time(0), length(0) {} @@ -42,9 +38,7 @@ public: llvm::MD5::MD5Result checksum; }; - //------------------------------------------------------------------ // Prologue - //------------------------------------------------------------------ struct Prologue { Prologue() @@ -145,9 +139,7 @@ public: // instruction set architecture for the current instruction. }; - //------------------------------------------------------------------ // LineTable - //------------------------------------------------------------------ struct LineTable { typedef std::shared_ptr<LineTable> shared_ptr; @@ -165,9 +157,7 @@ public: Row::collection rows; }; - //------------------------------------------------------------------ // State - //------------------------------------------------------------------ struct State : public Row { typedef void (*Callback)(dw_offset_t offset, const State &state, void *userData); diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h index 240829edd4f..9f5e28eb747 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h @@ -14,13 +14,11 @@ #include "lldb/Utility/ConstString.h" #include "DWARFDefines.h" -//---------------------------------------------------------------------- // DWARFDeclContext // // A class that represents a declaration context all the way down to a // DIE. This is useful when trying to find a DIE in one DWARF to a DIE // in another DWARF file. -//---------------------------------------------------------------------- class DWARFDeclContext { public: diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp index 7a1611629c2..58744a7a17c 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp @@ -34,9 +34,7 @@ DWARFUnit::DWARFUnit(SymbolFileDWARF *dwarf) DWARFUnit::~DWARFUnit() {} -//---------------------------------------------------------------------- // Parses first DIE of a compile unit. -//---------------------------------------------------------------------- void DWARFUnit::ExtractUnitDIEIfNeeded() { { llvm::sys::ScopedReader lock(m_first_die_mutex); @@ -67,10 +65,8 @@ void DWARFUnit::ExtractUnitDIEIfNeeded() { } } -//---------------------------------------------------------------------- // Parses a compile unit and indexes its DIEs if it hasn't already been done. // It will leave this compile unit extracted forever. -//---------------------------------------------------------------------- void DWARFUnit::ExtractDIEsIfNeeded() { m_cancel_scopes = true; @@ -86,13 +82,11 @@ void DWARFUnit::ExtractDIEsIfNeeded() { ExtractDIEsRWLocked(); } -//---------------------------------------------------------------------- // Parses a compile unit and indexes its DIEs if it hasn't already been done. // It will clear this compile unit after returned instance gets out of scope, // no other ScopedExtractDIEs instance is running for this compile unit // and no ExtractDIEsIfNeeded() has been executed during this ScopedExtractDIEs // lifetime. -//---------------------------------------------------------------------- DWARFUnit::ScopedExtractDIEs DWARFUnit::ExtractDIEsScoped() { ScopedExtractDIEs scoped(this); @@ -145,10 +139,8 @@ DWARFUnit::ScopedExtractDIEs &DWARFUnit::ScopedExtractDIEs::operator=( return *this; } -//---------------------------------------------------------------------- // Parses a compile unit and indexes its DIEs, m_die_array_mutex must be // held R/W and m_die_array must be empty. -//---------------------------------------------------------------------- void DWARFUnit::ExtractDIEsRWLocked() { llvm::sys::ScopedWriter first_die_lock(m_first_die_mutex); @@ -532,21 +524,17 @@ DWARFFormValue::FixedFormSizes DWARFUnit::GetFixedFormSizes() { void DWARFUnit::SetBaseAddress(dw_addr_t base_addr) { m_base_addr = base_addr; } -//---------------------------------------------------------------------- // Compare function DWARFDebugAranges::Range structures -//---------------------------------------------------------------------- static bool CompareDIEOffset(const DWARFDebugInfoEntry &die, const dw_offset_t die_offset) { return die.GetOffset() < die_offset; } -//---------------------------------------------------------------------- // GetDIE() // // Get the DIE (Debug Information Entry) with the specified offset by first // checking if the DIE is contained within this compile unit and grabbing the // DIE from this compile unit. Otherwise we grab the DIE from the DWARF file. -//---------------------------------------------------------------------- DWARFDIE DWARFUnit::GetDIE(dw_offset_t die_offset) { if (die_offset != DW_INVALID_OFFSET) { diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h index 0ced5797ec6..e3418d812a6 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h @@ -58,7 +58,6 @@ public: uint32_t depth = UINT32_MAX) const; bool Verify(lldb_private::Stream *s) const; virtual void Dump(lldb_private::Stream *s) const = 0; - //------------------------------------------------------------------ /// Get the data that contains the DIE information for this unit. /// /// This will return the correct bytes that contain the data for @@ -67,26 +66,21 @@ public: /// /// \return /// The correct data for the DIE information in this unit. - //------------------------------------------------------------------ virtual const lldb_private::DWARFDataExtractor &GetData() const = 0; - //------------------------------------------------------------------ /// Get the size in bytes of the compile unit header. /// /// \return /// Byte size of the compile unit header - //------------------------------------------------------------------ virtual uint32_t GetHeaderByteSize() const = 0; // Offset of the initial length field. dw_offset_t GetOffset() const { return m_offset; } lldb::user_id_t GetID() const; - //------------------------------------------------------------------ /// Get the size in bytes of the length field in the header. /// /// In DWARF32 this is just 4 bytes /// /// \return /// Byte size of the compile unit header length field - //------------------------------------------------------------------ size_t GetLengthByteSize() const { return 4; } bool ContainsDIEOffset(dw_offset_t die_offset) const { diff --git a/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp b/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp index 21242d1fe05..b214fd9391b 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp @@ -43,10 +43,8 @@ void ManualDWARFIndex::Index() { std::vector<IndexSet> sets(units_to_index.size()); - //---------------------------------------------------------------------- // Keep memory down by clearing DIEs for any compile units if indexing // caused us to load the compile unit's DIEs. - //---------------------------------------------------------------------- std::vector<llvm::Optional<DWARFUnit::ScopedExtractDIEs>> clear_cu_dies( units_to_index.size()); auto parser_fn = [&](size_t cu_idx) { @@ -59,14 +57,12 @@ void ManualDWARFIndex::Index() { // Create a task runner that extracts dies for each DWARF compile unit in a // separate thread - //---------------------------------------------------------------------- // First figure out which compile units didn't have their DIEs already // parsed and remember this. If no DIEs were parsed prior to this index // function call, we are going to want to clear the CU dies after we are // done indexing to make sure we don't pull in all DWARF dies, but we need // to wait until all compile units have been indexed in case a DIE in one // compile unit refers to another and the indexes accesses those DIEs. - //---------------------------------------------------------------------- TaskMapOverInt(0, units_to_index.size(), extract_fn); // Now create a task runner that can index each DWARF compile unit in a diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp index 3952a392911..5e6dd275388 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -328,10 +328,8 @@ size_t SymbolFileDWARF::GetTypes(SymbolContextScope *sc_scope, return num_types_added; } -//---------------------------------------------------------------------- // Gets the first parent that is a lexical block, function or inlined // subroutine, or compile unit. -//---------------------------------------------------------------------- DWARFDIE SymbolFileDWARF::GetParentSymbolContextDIE(const DWARFDIE &child_die) { DWARFDIE die; @@ -959,9 +957,7 @@ struct ParseDWARFLineTableCallbackInfo { lldb::addr_t addr_mask; }; -//---------------------------------------------------------------------- // ParseStatementTableCallback -//---------------------------------------------------------------------- static void ParseDWARFLineTableCallback(dw_offset_t offset, const DWARFDebugLine::State &state, void *userData) { @@ -2787,7 +2783,6 @@ TypeSP SymbolFileDWARF::FindCompleteObjCDefinitionTypeForDIE( return type_sp; } -//---------------------------------------------------------------------- // This function helps to ensure that the declaration contexts match for two // different DIEs. Often times debug information will refer to a forward // declaration of a type (the equivalent of "struct my_struct;". There will @@ -2797,7 +2792,6 @@ TypeSP SymbolFileDWARF::FindCompleteObjCDefinitionTypeForDIE( // type was in the same declaration context as the original DIE. This function // can efficiently compare two DIEs and will return true when the declaration // context matches, and false when they don't. -//---------------------------------------------------------------------- bool SymbolFileDWARF::DIEDeclContextsMatch(const DWARFDIE &die1, const DWARFDIE &die2) { if (die1 == die2) @@ -3788,9 +3782,7 @@ SymbolFileDWARF::ParseCallEdgesInFunction(UserID func_id) { return {}; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ ConstString SymbolFileDWARF::GetPluginName() { return GetPluginNameStatic(); } uint32_t SymbolFileDWARF::GetPluginVersion() { return 1; } diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h index 0328e5ff223..42ae231248b 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h @@ -36,9 +36,7 @@ #include "DWARFIndex.h" #include "UniqueDWARFASTType.h" -//---------------------------------------------------------------------- // Forward Declarations for this DWARF plugin -//---------------------------------------------------------------------- class DebugMapModule; class DWARFAbbreviationDeclaration; class DWARFAbbreviationDeclarationSet; @@ -68,9 +66,7 @@ public: friend class DWARFDIE; friend class DWARFASTParserClang; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -86,9 +82,7 @@ public: static const lldb_private::FileSpecList &GetSymlinkPaths(); - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ SymbolFileDWARF(lldb_private::ObjectFile *ofile); @@ -98,9 +92,7 @@ public: void InitializeObject() override; - //------------------------------------------------------------------ // Compile Unit function calls - //------------------------------------------------------------------ uint32_t GetNumCompileUnits() override; @@ -219,9 +211,7 @@ public: std::recursive_mutex &GetModuleMutex() const override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp index 582565662f7..e5bc63b3cb8 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp @@ -1230,9 +1230,7 @@ void SymbolFileDWARFDebugMap::DumpClangAST(Stream &s) { }); } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString SymbolFileDWARFDebugMap::GetPluginName() { return GetPluginNameStatic(); } diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h index 6f5dddcda23..b7dc2bcb2a8 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h @@ -24,9 +24,7 @@ class DWARFDeclContext; class SymbolFileDWARFDebugMap : public lldb_private::SymbolFile { public: - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -38,18 +36,14 @@ public: static lldb_private::SymbolFile * CreateInstance(lldb_private::ObjectFile *obj_file); - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ SymbolFileDWARFDebugMap(lldb_private::ObjectFile *ofile); ~SymbolFileDWARFDebugMap() override; uint32_t CalculateAbilities() override; void InitializeObject() override; - //------------------------------------------------------------------ // Compile Unit function calls - //------------------------------------------------------------------ uint32_t GetNumCompileUnits() override; lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index) override; @@ -130,9 +124,7 @@ public: void DumpClangAST(lldb_private::Stream &s) override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; @@ -157,9 +149,7 @@ protected: lldb::addr_t> FileRangeMap; - //------------------------------------------------------------------ // Class specific types - //------------------------------------------------------------------ struct CompileUnitInfo { lldb_private::FileSpec so_file; lldb_private::ConstString oso_path; @@ -182,9 +172,7 @@ protected: const FileRangeMap &GetFileRangeMap(SymbolFileDWARFDebugMap *exe_symfile); }; - //------------------------------------------------------------------ // Protected Member Functions - //------------------------------------------------------------------ void InitOSO(); static uint32_t GetOSOIndexFromUserID(lldb::user_id_t uid) { @@ -271,9 +259,7 @@ protected: return m_unique_ast_type_map; } - //------------------------------------------------------------------ // OSOEntry - //------------------------------------------------------------------ class OSOEntry { public: OSOEntry() @@ -302,9 +288,7 @@ protected: typedef lldb_private::RangeDataVector<lldb::addr_t, lldb::addr_t, OSOEntry> DebugMap; - //------------------------------------------------------------------ // Member Variables - //------------------------------------------------------------------ std::bitset<kNumFlags> m_flags; std::vector<CompileUnitInfo> m_compile_unit_infos; std::vector<uint32_t> m_func_indexes; // Sorted by address @@ -316,24 +300,19 @@ protected: lldb_private::LazyBool m_supports_DW_AT_APPLE_objc_complete_type; DebugMap m_debug_map; - //------------------------------------------------------------------ // When an object file from the debug map gets parsed in // SymbolFileDWARF, it needs to tell the debug map about the object // files addresses by calling this function once for each N_FUN, // N_GSYM and N_STSYM and after all entries in the debug map have // been matched up, FinalizeOSOFileRanges() should be called. - //------------------------------------------------------------------ bool AddOSOFileRange(CompileUnitInfo *cu_info, lldb::addr_t exe_file_addr, lldb::addr_t exe_byte_size, lldb::addr_t oso_file_addr, lldb::addr_t oso_byte_size); - //------------------------------------------------------------------ // Called after calling AddOSOFileRange() for each object file debug // map entry to finalize the info for the unlinked compile unit. - //------------------------------------------------------------------ void FinalizeOSOFileRanges(CompileUnitInfo *cu_info); - //------------------------------------------------------------------ /// Convert \a addr from a .o file address, to an executable address. /// /// \param[in] addr @@ -342,10 +321,8 @@ protected: /// \return /// Returns true if \a addr was converted to be an executable /// section/offset address, false otherwise. - //------------------------------------------------------------------ bool LinkOSOAddress(lldb_private::Address &addr); - //------------------------------------------------------------------ /// Convert a .o file "file address" to an executable "file address". /// /// \param[in] oso_symfile @@ -358,11 +335,9 @@ protected: /// LLDB_INVALID_ADDRESS if \a oso_file_addr is not in the /// linked executable, otherwise a valid "file address" from the /// linked executable that contains the debug map. - //------------------------------------------------------------------ lldb::addr_t LinkOSOFileAddress(SymbolFileDWARF *oso_symfile, lldb::addr_t oso_file_addr); - //------------------------------------------------------------------ /// Given a line table full of lines with "file addresses" that are /// for a .o file represented by \a oso_symfile, link a new line table /// and return it. @@ -377,7 +352,6 @@ protected: /// Returns a valid line table full of linked addresses, or NULL /// if none of the line table addresses exist in the main /// executable. - //------------------------------------------------------------------ lldb_private::LineTable * LinkOSOLineTable(SymbolFileDWARF *oso_symfile, lldb_private::LineTable *line_table); diff --git a/lldb/source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.h b/lldb/source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.h index 06e11941eca..1269dbac712 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.h @@ -18,9 +18,7 @@ class UniqueDWARFASTType { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ UniqueDWARFASTType() : m_type_sp(), m_die(), m_declaration(), m_byte_size( diff --git a/lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.h b/lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.h index 761d11bf273..60eece71661 100644 --- a/lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.h +++ b/lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.h @@ -50,9 +50,7 @@ struct DeclStatus { class PdbAstBuilder { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ PdbAstBuilder(ObjectFile &obj, PdbIndex &index); clang::DeclContext &GetTranslationUnitDecl(); diff --git a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h index 54cb4429c15..60dd7d48b53 100644 --- a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h +++ b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h @@ -44,9 +44,7 @@ class SymbolFileNativePDB : public SymbolFile { friend class UdtRecordCompleter; public: - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -59,9 +57,7 @@ public: static SymbolFile *CreateInstance(ObjectFile *obj_file); - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ SymbolFileNativePDB(ObjectFile *ofile); ~SymbolFileNativePDB() override; @@ -70,9 +66,7 @@ public: void InitializeObject() override; - //------------------------------------------------------------------ // Compile Unit function calls - //------------------------------------------------------------------ uint32_t GetNumCompileUnits() override; diff --git a/lldb/source/Plugins/SymbolFile/PDB/PDBLocationToDWARFExpression.h b/lldb/source/Plugins/SymbolFile/PDB/PDBLocationToDWARFExpression.h index 48e4aedd83e..2e9d1386d53 100644 --- a/lldb/source/Plugins/SymbolFile/PDB/PDBLocationToDWARFExpression.h +++ b/lldb/source/Plugins/SymbolFile/PDB/PDBLocationToDWARFExpression.h @@ -22,7 +22,6 @@ class PDBSymbolData; } } // namespace llvm -//------------------------------------------------------------------------------ /// Converts a location information from a PDB symbol to a DWARF expression /// /// \param[in] module @@ -40,7 +39,6 @@ class PDBSymbolData; /// /// \return /// The DWARF expression corresponding to the location data of \a symbol. -//------------------------------------------------------------------------------ lldb_private::DWARFExpression ConvertPDBLocationToDWARFExpression(lldb::ModuleSP module, const llvm::pdb::PDBSymbolData &symbol, diff --git a/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h b/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h index 853624e0d5f..ba3099aaec4 100644 --- a/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h +++ b/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h @@ -23,9 +23,7 @@ class PDBASTParser; class SymbolFilePDB : public lldb_private::SymbolFile { public: - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -39,9 +37,7 @@ public: static lldb_private::SymbolFile * CreateInstance(lldb_private::ObjectFile *obj_file); - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ SymbolFilePDB(lldb_private::ObjectFile *ofile); ~SymbolFilePDB() override; @@ -50,9 +46,7 @@ public: void InitializeObject() override; - //------------------------------------------------------------------ // Compile Unit function calls - //------------------------------------------------------------------ uint32_t GetNumCompileUnits() override; diff --git a/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp b/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp index d593e6313eb..7fa3a1c5d65 100644 --- a/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp +++ b/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp @@ -64,11 +64,9 @@ uint32_t SymbolFileSymtab::CalculateAbilities() { if (m_obj_file) { const Symtab *symtab = m_obj_file->GetSymtab(); if (symtab) { - //---------------------------------------------------------------------- // The snippet of code below will get the indexes the module symbol table // entries that are code, data, or function related (debug info), sort // them by value (address) and dump the sorted symbols. - //---------------------------------------------------------------------- if (symtab->AppendSymbolIndexesWithType(eSymbolTypeSourceFile, m_source_indexes)) { abilities |= CompileUnits; @@ -261,9 +259,7 @@ uint32_t SymbolFileSymtab::ResolveSymbolContext(const Address &so_addr, return resolved_flags; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString SymbolFileSymtab::GetPluginName() { return GetPluginNameStatic(); } diff --git a/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h b/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h index f2e90c95451..bc9a531419a 100644 --- a/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h +++ b/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h @@ -17,16 +17,12 @@ class SymbolFileSymtab : public lldb_private::SymbolFile { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ SymbolFileSymtab(lldb_private::ObjectFile *obj_file); ~SymbolFileSymtab() override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -40,9 +36,7 @@ public: uint32_t CalculateAbilities() override; - //------------------------------------------------------------------ // Compile Unit function calls - //------------------------------------------------------------------ uint32_t GetNumCompileUnits() override; lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index) override; @@ -85,9 +79,7 @@ public: lldb::TypeClass type_mask, lldb_private::TypeList &type_list) override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; |