Index: include/lldb/Core/Section.h =================================================================== --- include/lldb/Core/Section.h +++ include/lldb/Core/Section.h @@ -182,6 +182,8 @@ lldb::SectionType GetType() const { return m_type; } + const char *GetTypeAsCString() const; + lldb::SectionSP GetParent() const { return m_parent_wp.lock(); } bool IsThreadSpecific() const { return m_thread_specific; } Index: include/lldb/lldb-enumerations.h =================================================================== --- include/lldb/lldb-enumerations.h +++ include/lldb/lldb-enumerations.h @@ -656,6 +656,7 @@ eSectionTypeGoSymtab, eSectionTypeAbsoluteAddress, // Dummy section for symbols with absolute // address + eSectionTypeDWARFGNUDebugAltLink, eSectionTypeOther }; Index: lit/Modules/build-id-case.yaml =================================================================== --- lit/Modules/build-id-case.yaml +++ lit/Modules/build-id-case.yaml @@ -5,6 +5,7 @@ # RUN: lldb-test module-sections %t/stripped.out | FileCheck %s # CHECK: Name: .debug_frame +# CHECK-NEXT: Type: dwarf-frame # CHECK-NEXT: VM size: 0 # CHECK-NEXT: File size: 8 Index: lit/Modules/compressed-sections.yaml =================================================================== --- lit/Modules/compressed-sections.yaml +++ lit/Modules/compressed-sections.yaml @@ -18,12 +18,14 @@ Content: deadbeefbaadf00d # CHECK: Name: .hello_elf +# CHECK-NEXT: Type: regular # CHECK-NEXT: VM size: 0 # CHECK-NEXT: File size: 28 # CHECK-NEXT: Data: # CHECK-NEXT: 20304050 60708090 # CHECK: Name: .bogus +# CHECK-NEXT: Type: regular # CHECK-NEXT: VM size: 0 # CHECK-NEXT: File size: 8 # CHECK-NEXT: Data: Index: source/Core/Section.cpp =================================================================== --- source/Core/Section.cpp +++ source/Core/Section.cpp @@ -27,8 +27,8 @@ using namespace lldb; using namespace lldb_private; -static const char *GetSectionTypeAsCString(lldb::SectionType sect_type) { - switch (sect_type) { +const char *Section::GetTypeAsCString() const { + switch (m_type) { case eSectionTypeInvalid: return "invalid"; case eSectionTypeCode: @@ -117,6 +117,8 @@ return "go-symtab"; case eSectionTypeAbsoluteAddress: return "absolute"; + case eSectionTypeDWARFGNUDebugAltLink: + return "dwarf-gnu-debugaltlink"; case eSectionTypeOther: return "regular"; } @@ -283,8 +285,7 @@ void Section::Dump(Stream *s, Target *target, uint32_t depth) const { // s->Printf("%.*p: ", (int)sizeof(void*) * 2, this); s->Indent(); - s->Printf("0x%8.8" PRIx64 " %-16s ", GetID(), - GetSectionTypeAsCString(m_type)); + s->Printf("0x%8.8" PRIx64 " %-16s ", GetID(), GetTypeAsCString()); bool resolved = true; addr_t addr = LLDB_INVALID_ADDRESS; Index: source/Expression/IRExecutionUnit.cpp =================================================================== --- source/Expression/IRExecutionUnit.cpp +++ source/Expression/IRExecutionUnit.cpp @@ -1100,6 +1100,7 @@ case lldb::eSectionTypeDWARFAppleTypes: case lldb::eSectionTypeDWARFAppleNamespaces: case lldb::eSectionTypeDWARFAppleObjC: + case lldb::eSectionTypeDWARFGNUDebugAltLink: error.Clear(); break; default: Index: source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp =================================================================== --- source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -1823,6 +1823,7 @@ static ConstString g_sect_name_arm_exidx(".ARM.exidx"); static ConstString g_sect_name_arm_extab(".ARM.extab"); static ConstString g_sect_name_go_symtab(".gosymtab"); + static ConstString g_sect_name_dwarf_gnu_debugaltlink(".gnu_debugaltlink"); SectionType sect_type = eSectionTypeOther; @@ -1913,6 +1914,8 @@ sect_type = eSectionTypeARMextab; else if (name == g_sect_name_go_symtab) sect_type = eSectionTypeGoSymtab; + else if (name == g_sect_name_dwarf_gnu_debugaltlink) + sect_type = eSectionTypeDWARFGNUDebugAltLink; const uint32_t permissions = ((header.sh_flags & SHF_ALLOC) ? ePermissionsReadable : 0u) | Index: source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp =================================================================== --- source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +++ source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp @@ -1212,6 +1212,7 @@ case eSectionTypeDWARFAppleTypes: case eSectionTypeDWARFAppleNamespaces: case eSectionTypeDWARFAppleObjC: + case eSectionTypeDWARFGNUDebugAltLink: return eAddressClassDebug; case eSectionTypeEHFrame: Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h =================================================================== --- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h +++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h @@ -250,6 +250,7 @@ const lldb_private::DWARFDataExtractor &get_apple_types_data(); const lldb_private::DWARFDataExtractor &get_apple_namespaces_data(); const lldb_private::DWARFDataExtractor &get_apple_objc_data(); + const lldb_private::DWARFDataExtractor &get_gnu_debugaltlink(); DWARFDebugAbbrev *DebugAbbrev(); @@ -495,6 +496,7 @@ DWARFDataSegment m_data_apple_types; DWARFDataSegment m_data_apple_namespaces; DWARFDataSegment m_data_apple_objc; + DWARFDataSegment m_data_gnu_debugaltlink; // The unique pointer items below are generated on demand if and when someone // accesses Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp =================================================================== --- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -681,6 +681,11 @@ return GetCachedSectionData(eSectionTypeDWARFAppleObjC, m_data_apple_objc); } +const DWARFDataExtractor &SymbolFileDWARF::get_gnu_debugaltlink() { + return GetCachedSectionData(eSectionTypeDWARFGNUDebugAltLink, + m_data_gnu_debugaltlink); +} + DWARFDebugAbbrev *SymbolFileDWARF::DebugAbbrev() { if (m_abbr.get() == NULL) { const DWARFDataExtractor &debug_abbrev_data = get_debug_abbrev_data(); Index: source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp =================================================================== --- source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp +++ source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp @@ -134,7 +134,7 @@ eSectionTypeDWARFDebugMacInfo, eSectionTypeDWARFDebugPubNames, eSectionTypeDWARFDebugPubTypes, eSectionTypeDWARFDebugRanges, eSectionTypeDWARFDebugStr, eSectionTypeDWARFDebugStrOffsets, - eSectionTypeELFSymbolTable, + eSectionTypeELFSymbolTable, eSectionTypeDWARFGNUDebugAltLink, }; for (size_t idx = 0; idx < sizeof(g_sections) / sizeof(g_sections[0]); ++idx) { Index: source/Symbol/ObjectFile.cpp =================================================================== --- source/Symbol/ObjectFile.cpp +++ source/Symbol/ObjectFile.cpp @@ -363,6 +363,7 @@ case eSectionTypeDWARFAppleTypes: case eSectionTypeDWARFAppleNamespaces: case eSectionTypeDWARFAppleObjC: + case eSectionTypeDWARFGNUDebugAltLink: return eAddressClassDebug; case eSectionTypeEHFrame: case eSectionTypeARMexidx: Index: tools/lldb-test/lldb-test.cpp =================================================================== --- tools/lldb-test/lldb-test.cpp +++ tools/lldb-test/lldb-test.cpp @@ -213,6 +213,7 @@ assert(S); Printer.formatLine("Index: {0}", I); Printer.formatLine("Name: {0}", S->GetName().GetStringRef()); + Printer.formatLine("Type: {0}", S->GetTypeAsCString()); Printer.formatLine("VM size: {0}", S->GetByteSize()); Printer.formatLine("File size: {0}", S->GetFileSize());