[lldb] Add boilerplate to recognize the .debug_tu_index section

It's just like debug_cu_index, only for type units.
This commit is contained in:
Pavel Labath
2020-02-20 13:42:52 +01:00
parent 0e417b034a
commit 7b59ff2fa0
6 changed files with 20 additions and 0 deletions

View File

@@ -695,6 +695,7 @@ enum SectionType {
eSectionTypeDWARFDebugRngListsDwo,
eSectionTypeDWARFDebugLocDwo,
eSectionTypeDWARFDebugLocListsDwo,
eSectionTypeDWARFDebugTuIndex,
};
FLAGS_ENUM(EmulateInstructionOptions){

View File

@@ -68,6 +68,8 @@ const char *Section::GetTypeAsCString() const {
return "dwarf-aranges";
case eSectionTypeDWARFDebugCuIndex:
return "dwarf-cu-index";
case eSectionTypeDWARFDebugTuIndex:
return "dwarf-tu-index";
case eSectionTypeDWARFDebugFrame:
return "dwarf-frame";
case eSectionTypeDWARFDebugInfo:

View File

@@ -1592,6 +1592,7 @@ static SectionType GetSectionTypeFromName(llvm::StringRef Name) {
.Case("str.dwo", eSectionTypeDWARFDebugStrDwo)
.Case("str_offsets", eSectionTypeDWARFDebugStrOffsets)
.Case("str_offsets.dwo", eSectionTypeDWARFDebugStrOffsetsDwo)
.Case("tu_index", eSectionTypeDWARFDebugTuIndex)
.Case("types", eSectionTypeDWARFDebugTypes)
.Case("types.dwo", eSectionTypeDWARFDebugTypesDwo)
.Default(eSectionTypeOther);

View File

@@ -1150,6 +1150,7 @@ AddressClass ObjectFileMachO::GetAddressClass(lldb::addr_t file_addr) {
case eSectionTypeDWARFDebugStrDwo:
case eSectionTypeDWARFDebugStrOffsets:
case eSectionTypeDWARFDebugStrOffsetsDwo:
case eSectionTypeDWARFDebugTuIndex:
case eSectionTypeDWARFDebugTypes:
case eSectionTypeDWARFDebugTypesDwo:
case eSectionTypeDWARFAppleNames:

View File

@@ -367,6 +367,7 @@ AddressClass ObjectFile::GetAddressClass(addr_t file_addr) {
case eSectionTypeDWARFDebugStrDwo:
case eSectionTypeDWARFDebugStrOffsets:
case eSectionTypeDWARFDebugStrOffsetsDwo:
case eSectionTypeDWARFDebugTuIndex:
case eSectionTypeDWARFDebugTypes:
case eSectionTypeDWARFDebugTypesDwo:
case eSectionTypeDWARFAppleNames:

View File

@@ -34,6 +34,12 @@
# CHECK-LABEL: Name: .debug_names
# CHECK-NEXT: Type: dwarf-names
# CHECK-LABEL: Name: .debug_cu_index
# CHECK-NEXT: Type: dwarf-cu-index
# CHECK-LABEL: Name: .debug_tu_index
# CHECK-NEXT: Type: dwarf-tu-index
# CHECK-LABEL: Name: .gnu_debugaltlink
# CHECK-NEXT: Type: dwarf-gnu-debugaltlink
@@ -104,6 +110,14 @@ Sections:
Type: SHT_PROGBITS
AddressAlign: 0x0000000000000001
Content: DEADBEEFBAADF00D
- Name: .debug_cu_index
Type: SHT_PROGBITS
AddressAlign: 0x0000000000000001
Content: DEADBEEFBAADF00D
- Name: .debug_tu_index
Type: SHT_PROGBITS
AddressAlign: 0x0000000000000001
Content: DEADBEEFBAADF00D
- Name: .gnu_debugaltlink
Type: SHT_PROGBITS
AddressAlign: 0x0000000000000001