[Lldb-commits] [lldb] 7b59ff2 - [lldb] Add boilerplate to recognize the .debug_tu_index section
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Thu Feb 20 04:44:29 PST 2020
Author: Pavel Labath
Date: 2020-02-20T13:44:21+01:00
New Revision: 7b59ff2fa0a56a0158f3f21aaed217118da669a3
URL: https://github.com/llvm/llvm-project/commit/7b59ff2fa0a56a0158f3f21aaed217118da669a3
DIFF: https://github.com/llvm/llvm-project/commit/7b59ff2fa0a56a0158f3f21aaed217118da669a3.diff
LOG: [lldb] Add boilerplate to recognize the .debug_tu_index section
It's just like debug_cu_index, only for type units.
Added:
Modified:
lldb/include/lldb/lldb-enumerations.h
lldb/source/Core/Section.cpp
lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
lldb/source/Symbol/ObjectFile.cpp
lldb/test/Shell/ObjectFile/ELF/section-types.yaml
Removed:
################################################################################
diff --git a/lldb/include/lldb/lldb-enumerations.h b/lldb/include/lldb/lldb-enumerations.h
index 1347f91a9b3e..543e454c27c8 100644
--- a/lldb/include/lldb/lldb-enumerations.h
+++ b/lldb/include/lldb/lldb-enumerations.h
@@ -695,6 +695,7 @@ enum SectionType {
eSectionTypeDWARFDebugRngListsDwo,
eSectionTypeDWARFDebugLocDwo,
eSectionTypeDWARFDebugLocListsDwo,
+ eSectionTypeDWARFDebugTuIndex,
};
FLAGS_ENUM(EmulateInstructionOptions){
diff --git a/lldb/source/Core/Section.cpp b/lldb/source/Core/Section.cpp
index 1d5fd603e57c..94adab29b880 100644
--- a/lldb/source/Core/Section.cpp
+++ b/lldb/source/Core/Section.cpp
@@ -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:
diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
index a328e16e4bde..403aa5909bd6 100644
--- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -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);
diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
index afa9b645cbec..5b75e1f2a2ec 100644
--- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
+++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
@@ -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:
diff --git a/lldb/source/Symbol/ObjectFile.cpp b/lldb/source/Symbol/ObjectFile.cpp
index 0367703db1ae..5a4680b01103 100644
--- a/lldb/source/Symbol/ObjectFile.cpp
+++ b/lldb/source/Symbol/ObjectFile.cpp
@@ -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:
diff --git a/lldb/test/Shell/ObjectFile/ELF/section-types.yaml b/lldb/test/Shell/ObjectFile/ELF/section-types.yaml
index 7d59b3b4870d..7c12a52038c2 100644
--- a/lldb/test/Shell/ObjectFile/ELF/section-types.yaml
+++ b/lldb/test/Shell/ObjectFile/ELF/section-types.yaml
@@ -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
More information about the lldb-commits
mailing list