From 7f3c702b19f38c21445a05124c33d49cddbd99cf Mon Sep 17 00:00:00 2001 From: Dave Lee Date: Thu, 7 Dec 2023 16:16:44 -0800 Subject: [PATCH 1/9] [lldb] Load embedded type summary section --- lldb/source/Target/Target.cpp | 50 +++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp index 33560b2adb15e..971bc2c56467f 100644 --- a/lldb/source/Target/Target.cpp +++ b/lldb/source/Target/Target.cpp @@ -27,6 +27,7 @@ #include "lldb/Core/StructuredDataImpl.h" #include "lldb/Core/ValueObject.h" #include "lldb/Core/ValueObjectConstResult.h" +#include "lldb/DataFormatters/DataVisualization.h" #include "lldb/Expression/DiagnosticManager.h" #include "lldb/Expression/ExpressionVariable.h" #include "lldb/Expression/REPL.h" @@ -1438,6 +1439,54 @@ static void LoadScriptingResourceForModule(const ModuleSP &module_sp, feedback_stream.GetData()); } +static void LoadTypeSummariesForModule(ModuleSP module_sp) { + auto *sections = module_sp->GetSectionList(); + if (!sections) + return; + + llvm::Triple triple = module_sp->GetArchitecture().GetTriple(); + SectionSP summaries_sp; + if (triple.isOSDarwin()) { + if (auto data_sp = sections->FindSectionByName(ConstString("__DATA_CONST"))) + summaries_sp = data_sp->GetChildren().FindSectionByName( + ConstString("__lldbsummaries")); + } else if (triple.isOSLinux() || triple.isOSWindows()) { + summaries_sp = sections->FindSectionByName(ConstString(".lldbsummaries")); + } + + if (!summaries_sp) + return; + + TypeCategoryImplSP category; + DataVisualization::Categories::GetCategory(ConstString("default"), category); + + DataExtractor extractor; + auto section_size = summaries_sp->GetSectionData(extractor); + lldb::offset_t offset = 0; + while (offset < section_size) { + uint64_t version = extractor.GetULEB128(&offset); + uint64_t record_size = extractor.GetULEB128(&offset); + if (version == 1) { + uint64_t type_size = extractor.GetULEB128(&offset); + llvm::StringRef type_name = extractor.GetCStr(&offset, type_size); + uint64_t summary_size = extractor.GetULEB128(&offset); + llvm::StringRef summary_string = extractor.GetCStr(&offset, summary_size); + if (!type_name.empty() && !summary_string.empty()) { + TypeSummaryImpl::Flags flags; + auto summary_sp = + std::make_shared(flags, summary_string.data()); + FormatterMatchType match_type = lldb::eFormatterMatchExact; + if (summary_string.front() == '^' && summary_string.back() == '$') + match_type = eFormatterMatchRegex; + category->AddTypeSummary(type_name, match_type, summary_sp); + } + } else { + // Skip unsupported record. + offset += record_size; + } + } +} + void Target::ClearModules(bool delete_locations) { ModulesDidUnload(m_images, delete_locations); m_section_load_history.Clear(); @@ -1682,6 +1731,7 @@ void Target::ModulesDidLoad(ModuleList &module_list) { for (size_t idx = 0; idx < num_images; ++idx) { ModuleSP module_sp(module_list.GetModuleAtIndex(idx)); LoadScriptingResourceForModule(module_sp, this); + LoadTypeSummariesForModule(module_sp); } m_breakpoint_list.UpdateBreakpoints(module_list, true, false); m_internal_breakpoint_list.UpdateBreakpoints(module_list, true, false); From aad1da8843c42beaf62889e0ccfa546f7392990a Mon Sep 17 00:00:00 2001 From: Dave Lee Date: Fri, 8 Dec 2023 10:18:54 -0800 Subject: [PATCH 2/9] Add unit test --- .../data-formatter/embedded-summary/Makefile | 2 ++ .../embedded-summary/TestEmbeddedSummary.py | 10 +++++++++ .../data-formatter/embedded-summary/main.c | 22 +++++++++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 lldb/test/API/functionalities/data-formatter/embedded-summary/Makefile create mode 100644 lldb/test/API/functionalities/data-formatter/embedded-summary/TestEmbeddedSummary.py create mode 100644 lldb/test/API/functionalities/data-formatter/embedded-summary/main.c diff --git a/lldb/test/API/functionalities/data-formatter/embedded-summary/Makefile b/lldb/test/API/functionalities/data-formatter/embedded-summary/Makefile new file mode 100644 index 0000000000000..c9319d6e6888a --- /dev/null +++ b/lldb/test/API/functionalities/data-formatter/embedded-summary/Makefile @@ -0,0 +1,2 @@ +C_SOURCES := main.c +include Makefile.rules diff --git a/lldb/test/API/functionalities/data-formatter/embedded-summary/TestEmbeddedSummary.py b/lldb/test/API/functionalities/data-formatter/embedded-summary/TestEmbeddedSummary.py new file mode 100644 index 0000000000000..8e78e514c1c8c --- /dev/null +++ b/lldb/test/API/functionalities/data-formatter/embedded-summary/TestEmbeddedSummary.py @@ -0,0 +1,10 @@ +import lldb +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + + +class TestCase(TestBase): + def test(self): + self.build() + lldbutil.run_to_source_breakpoint(self, "break here", lldb.SBFileSpec("main.c")) + self.expect("v player", substrs=['"Dirk" (41)']) diff --git a/lldb/test/API/functionalities/data-formatter/embedded-summary/main.c b/lldb/test/API/functionalities/data-formatter/embedded-summary/main.c new file mode 100644 index 0000000000000..fab4e74a97c34 --- /dev/null +++ b/lldb/test/API/functionalities/data-formatter/embedded-summary/main.c @@ -0,0 +1,22 @@ +#include + +struct Player { + char *name; + int number; +}; + +__attribute__((used, section("__DATA_CONST,__lldbsummaries"))) unsigned char + _Movie_type_summary[] = "\x01" // version + "\x25" // record size + "\x07" // type name size + "Player\0" // type name + "\x1c" // summary string size + "${var.name} (${var.number})"; // summary string + +int main() { + struct Player player; + player.name = "Dirk"; + player.number = 41; + puts("break here"); + return 0; +} From 70668d5f87809dcb4a6b5abd7c265ae49e6bad6a Mon Sep 17 00:00:00 2001 From: Dave Lee Date: Fri, 8 Dec 2023 10:44:46 -0800 Subject: [PATCH 3/9] Test is Darwin-only for now --- .../data-formatter/embedded-summary/TestEmbeddedSummary.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lldb/test/API/functionalities/data-formatter/embedded-summary/TestEmbeddedSummary.py b/lldb/test/API/functionalities/data-formatter/embedded-summary/TestEmbeddedSummary.py index 8e78e514c1c8c..b8ce7d9f76eb9 100644 --- a/lldb/test/API/functionalities/data-formatter/embedded-summary/TestEmbeddedSummary.py +++ b/lldb/test/API/functionalities/data-formatter/embedded-summary/TestEmbeddedSummary.py @@ -1,9 +1,11 @@ import lldb +from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class TestCase(TestBase): + @skipUnlessDarwin def test(self): self.build() lldbutil.run_to_source_breakpoint(self, "break here", lldb.SBFileSpec("main.c")) From ef436d0f709118b97acaf5c13cfb9c94c44268fc Mon Sep 17 00:00:00 2001 From: Dave Lee Date: Fri, 8 Dec 2023 12:58:15 -0800 Subject: [PATCH 4/9] Added comments and logs --- lldb/source/Target/Target.cpp | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp index 971bc2c56467f..e321f13aba657 100644 --- a/lldb/source/Target/Target.cpp +++ b/lldb/source/Target/Target.cpp @@ -1439,6 +1439,8 @@ static void LoadScriptingResourceForModule(const ModuleSP &module_sp, feedback_stream.GetData()); } +// Load type summaries embedded in the binary. These are type summaries provided +// by the authors of the code. static void LoadTypeSummariesForModule(ModuleSP module_sp) { auto *sections = module_sp->GetSectionList(); if (!sections) @@ -1457,9 +1459,27 @@ static void LoadTypeSummariesForModule(ModuleSP module_sp) { if (!summaries_sp) return; + Log *log = GetLog(LLDBLog::DataFormatters); + const char *module_name = module_sp->GetObjectName().GetCString(); + TypeCategoryImplSP category; DataVisualization::Categories::GetCategory(ConstString("default"), category); + // The type summary record is serialized as follows. + // + // Each record contains, in order: + // * Version number of the record format + // * The remaining size of the record + // * The size of the type identifier + // * The type identifier, either a type name, or a regex + // * The size of the summary string + // * The summary string + // + // Integers are encoded using ULEB. + // + // Strings are encoded with first a length (ULEB), then the string contents, + // and lastly a null terminator. The length includes the null. + DataExtractor extractor; auto section_size = summaries_sp->GetSectionData(extractor); lldb::offset_t offset = 0; @@ -1475,14 +1495,24 @@ static void LoadTypeSummariesForModule(ModuleSP module_sp) { TypeSummaryImpl::Flags flags; auto summary_sp = std::make_shared(flags, summary_string.data()); - FormatterMatchType match_type = lldb::eFormatterMatchExact; + FormatterMatchType match_type = eFormatterMatchExact; if (summary_string.front() == '^' && summary_string.back() == '$') match_type = eFormatterMatchRegex; category->AddTypeSummary(type_name, match_type, summary_sp); + LLDB_LOGF(log, "Loaded embedded type summary for '%s' from %s.", + type_name.data(), module_name); + } else { + if (type_name.empty()) + LLDB_LOGF(log, "Missing string(s) in embedded type summary in %s.", + module_name); } } else { // Skip unsupported record. offset += record_size; + LLDB_LOGF( + log, + "Skipping unsupported embedded type summary of version %llu in %s.", + version, module_name); } } } From c0ada5d114dbdaf9d5d44209af31202ed48acb76 Mon Sep 17 00:00:00 2001 From: Dave Lee Date: Fri, 8 Dec 2023 13:15:10 -0800 Subject: [PATCH 5/9] Minor fixes --- ...EmbeddedSummary.py => TestEmbeddedTypeSummary.py} | 0 .../data-formatter/embedded-summary/main.c | 12 ++++++------ 2 files changed, 6 insertions(+), 6 deletions(-) rename lldb/test/API/functionalities/data-formatter/embedded-summary/{TestEmbeddedSummary.py => TestEmbeddedTypeSummary.py} (100%) diff --git a/lldb/test/API/functionalities/data-formatter/embedded-summary/TestEmbeddedSummary.py b/lldb/test/API/functionalities/data-formatter/embedded-summary/TestEmbeddedTypeSummary.py similarity index 100% rename from lldb/test/API/functionalities/data-formatter/embedded-summary/TestEmbeddedSummary.py rename to lldb/test/API/functionalities/data-formatter/embedded-summary/TestEmbeddedTypeSummary.py diff --git a/lldb/test/API/functionalities/data-formatter/embedded-summary/main.c b/lldb/test/API/functionalities/data-formatter/embedded-summary/main.c index fab4e74a97c34..9ddd64246f726 100644 --- a/lldb/test/API/functionalities/data-formatter/embedded-summary/main.c +++ b/lldb/test/API/functionalities/data-formatter/embedded-summary/main.c @@ -6,12 +6,12 @@ struct Player { }; __attribute__((used, section("__DATA_CONST,__lldbsummaries"))) unsigned char - _Movie_type_summary[] = "\x01" // version - "\x25" // record size - "\x07" // type name size - "Player\0" // type name - "\x1c" // summary string size - "${var.name} (${var.number})"; // summary string + _Player_type_summary[] = "\x01" // version + "\x25" // record size + "\x07" // type name size + "Player\0" // type name + "\x1c" // summary string size + "${var.name} (${var.number})"; // summary string int main() { struct Player player; From 137a2116a0907f26467ef6afb253fc6b63eaee36 Mon Sep 17 00:00:00 2001 From: Dave Lee Date: Mon, 11 Dec 2023 10:25:32 -0800 Subject: [PATCH 6/9] Introduce eSectionTypeEmbeddedTypeSummaries --- lldb/include/lldb/lldb-enumerations.h | 1 + lldb/source/Core/Section.cpp | 3 +++ lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp | 2 +- lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp | 5 +++++ lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp | 1 + lldb/source/Symbol/ObjectFile.cpp | 1 + 6 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lldb/include/lldb/lldb-enumerations.h b/lldb/include/lldb/lldb-enumerations.h index cdd6650c3e4ba..88a1b6a8679cd 100644 --- a/lldb/include/lldb/lldb-enumerations.h +++ b/lldb/include/lldb/lldb-enumerations.h @@ -770,6 +770,7 @@ enum SectionType { eSectionTypeDWARFDebugLocListsDwo, eSectionTypeDWARFDebugTuIndex, eSectionTypeCTF, + eSectionTypeEmbeddedTypeSummaries, }; FLAGS_ENUM(EmulateInstructionOptions){ diff --git a/lldb/source/Core/Section.cpp b/lldb/source/Core/Section.cpp index 2a1c367b0539b..203aa69c44327 100644 --- a/lldb/source/Core/Section.cpp +++ b/lldb/source/Core/Section.cpp @@ -149,6 +149,8 @@ const char *Section::GetTypeAsCString() const { return "dwarf-gnu-debugaltlink"; case eSectionTypeCTF: return "ctf"; + case eSectionTypeEmbeddedTypeSummaries: + return "embedded-type-summaries"; case eSectionTypeOther: return "regular"; @@ -465,6 +467,7 @@ bool Section::ContainsOnlyDebugInfo() const { case eSectionTypeDWARFAppleObjC: case eSectionTypeDWARFGNUDebugAltLink: case eSectionTypeCTF: + case eSectionTypeEmbeddedTypeSummaries: return true; } return false; diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp index 09f7ba508b52c..ae85b41611188 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -1685,7 +1685,7 @@ static SectionType GetSectionTypeFromName(llvm::StringRef Name) { .Case(".text", eSectionTypeCode) // Swift support: .Case(".swift_ast", eSectionTypeSwiftModules) - // + .Case(".lldbsummaries", lldb::eSectionTypeEmbeddedTypeSummaries) .Default(eSectionTypeOther); } diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp index e6119ab7a34d1..2a208623a6a47 100644 --- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp @@ -1208,6 +1208,7 @@ AddressClass ObjectFileMachO::GetAddressClass(lldb::addr_t file_addr) { case eSectionTypeSwiftModules: case eSectionTypeDWARFGNUDebugAltLink: case eSectionTypeCTF: + case eSectionTypeEmbeddedTypeSummaries: return AddressClass::eDebug; case eSectionTypeEHFrame: @@ -1485,6 +1486,7 @@ static lldb::SectionType GetSectionType(uint32_t flags, static ConstString g_sect_name_swift_ast("__swift_ast"); static ConstString g_sect_name_go_symtab("__gosymtab"); static ConstString g_sect_name_ctf("__ctf"); + static ConstString g_sect_name_lldb_summaries("__lldbsummaries"); if (section_name == g_sect_name_dwarf_debug_abbrev) return eSectionTypeDWARFDebugAbbrev; @@ -1573,6 +1575,9 @@ static lldb::SectionType GetSectionType(uint32_t flags, section_name == g_sect_name_objc_classlist) { return eSectionTypeDataPointers; } + if (section_name == g_sect_name_lldb_summaries) { + return lldb::eSectionTypeEmbeddedTypeSummaries; + } switch (mach_sect_type) { // TODO: categorize sections by other flags for regular sections diff --git a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp index a7dfd9fa16fcf..2dad25f015219 100644 --- a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp +++ b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp @@ -1015,6 +1015,7 @@ SectionType ObjectFilePECOFF::GetSectionType(llvm::StringRef sect_name, .Cases(".eh_frame", ".eh_fram", eSectionTypeEHFrame) .Case(".gosymtab", eSectionTypeGoSymtab) .Case("swiftast", eSectionTypeSwiftModules) // downstream change + .Case(".lldbsummaries", lldb::eSectionTypeEmbeddedTypeSummaries) .Default(eSectionTypeInvalid); if (section_type != eSectionTypeInvalid) return section_type; diff --git a/lldb/source/Symbol/ObjectFile.cpp b/lldb/source/Symbol/ObjectFile.cpp index 1c4c22fc3c5d6..74d282154ea97 100644 --- a/lldb/source/Symbol/ObjectFile.cpp +++ b/lldb/source/Symbol/ObjectFile.cpp @@ -358,6 +358,7 @@ AddressClass ObjectFile::GetAddressClass(addr_t file_addr) { case eSectionTypeSwiftModules: case eSectionTypeDWARFGNUDebugAltLink: case eSectionTypeCTF: + case eSectionTypeEmbeddedTypeSummaries: return AddressClass::eDebug; case eSectionTypeEHFrame: case eSectionTypeARMexidx: From 7f946241d908925d177685e43f1a67c69f8c1416 Mon Sep 17 00:00:00 2001 From: Dave Lee Date: Mon, 11 Dec 2023 10:31:32 -0800 Subject: [PATCH 7/9] Use FindSectionByType --- lldb/source/Target/Target.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp index e321f13aba657..5825358195532 100644 --- a/lldb/source/Target/Target.cpp +++ b/lldb/source/Target/Target.cpp @@ -1446,16 +1446,8 @@ static void LoadTypeSummariesForModule(ModuleSP module_sp) { if (!sections) return; - llvm::Triple triple = module_sp->GetArchitecture().GetTriple(); - SectionSP summaries_sp; - if (triple.isOSDarwin()) { - if (auto data_sp = sections->FindSectionByName(ConstString("__DATA_CONST"))) - summaries_sp = data_sp->GetChildren().FindSectionByName( - ConstString("__lldbsummaries")); - } else if (triple.isOSLinux() || triple.isOSWindows()) { - summaries_sp = sections->FindSectionByName(ConstString(".lldbsummaries")); - } - + auto summaries_sp = + sections->FindSectionByType(eSectionTypeEmbeddedTypeSummaries, true); if (!summaries_sp) return; From ad88e6fdecf4949fbe35f85c876b47a0cf91f028 Mon Sep 17 00:00:00 2001 From: Dave Lee Date: Mon, 11 Dec 2023 11:04:06 -0800 Subject: [PATCH 8/9] Rename to eSectionTypeLLDBTypeSummaries --- lldb/include/lldb/lldb-enumerations.h | 2 +- lldb/source/Core/Section.cpp | 4 ++-- lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp | 2 +- lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp | 4 ++-- lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp | 2 +- lldb/source/Symbol/ObjectFile.cpp | 2 +- lldb/source/Target/Target.cpp | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lldb/include/lldb/lldb-enumerations.h b/lldb/include/lldb/lldb-enumerations.h index 88a1b6a8679cd..459fb0689fdb5 100644 --- a/lldb/include/lldb/lldb-enumerations.h +++ b/lldb/include/lldb/lldb-enumerations.h @@ -770,7 +770,7 @@ enum SectionType { eSectionTypeDWARFDebugLocListsDwo, eSectionTypeDWARFDebugTuIndex, eSectionTypeCTF, - eSectionTypeEmbeddedTypeSummaries, + eSectionTypeLLDBTypeSummaries, }; FLAGS_ENUM(EmulateInstructionOptions){ diff --git a/lldb/source/Core/Section.cpp b/lldb/source/Core/Section.cpp index 203aa69c44327..1b1d61b8e7244 100644 --- a/lldb/source/Core/Section.cpp +++ b/lldb/source/Core/Section.cpp @@ -149,7 +149,7 @@ const char *Section::GetTypeAsCString() const { return "dwarf-gnu-debugaltlink"; case eSectionTypeCTF: return "ctf"; - case eSectionTypeEmbeddedTypeSummaries: + case eSectionTypeLLDBTypeSummaries: return "embedded-type-summaries"; case eSectionTypeOther: return "regular"; @@ -467,7 +467,7 @@ bool Section::ContainsOnlyDebugInfo() const { case eSectionTypeDWARFAppleObjC: case eSectionTypeDWARFGNUDebugAltLink: case eSectionTypeCTF: - case eSectionTypeEmbeddedTypeSummaries: + case eSectionTypeLLDBTypeSummaries: return true; } return false; diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp index ae85b41611188..323a4cb6d6c96 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -1685,7 +1685,7 @@ static SectionType GetSectionTypeFromName(llvm::StringRef Name) { .Case(".text", eSectionTypeCode) // Swift support: .Case(".swift_ast", eSectionTypeSwiftModules) - .Case(".lldbsummaries", lldb::eSectionTypeEmbeddedTypeSummaries) + .Case(".lldbsummaries", lldb::eSectionTypeLLDBTypeSummaries) .Default(eSectionTypeOther); } diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp index 2a208623a6a47..ebb590aea84d5 100644 --- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp @@ -1208,7 +1208,7 @@ AddressClass ObjectFileMachO::GetAddressClass(lldb::addr_t file_addr) { case eSectionTypeSwiftModules: case eSectionTypeDWARFGNUDebugAltLink: case eSectionTypeCTF: - case eSectionTypeEmbeddedTypeSummaries: + case eSectionTypeLLDBTypeSummaries: return AddressClass::eDebug; case eSectionTypeEHFrame: @@ -1576,7 +1576,7 @@ static lldb::SectionType GetSectionType(uint32_t flags, return eSectionTypeDataPointers; } if (section_name == g_sect_name_lldb_summaries) { - return lldb::eSectionTypeEmbeddedTypeSummaries; + return lldb::eSectionTypeLLDBTypeSummaries; } switch (mach_sect_type) { diff --git a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp index 2dad25f015219..2de93c2cefd23 100644 --- a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp +++ b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp @@ -1015,7 +1015,7 @@ SectionType ObjectFilePECOFF::GetSectionType(llvm::StringRef sect_name, .Cases(".eh_frame", ".eh_fram", eSectionTypeEHFrame) .Case(".gosymtab", eSectionTypeGoSymtab) .Case("swiftast", eSectionTypeSwiftModules) // downstream change - .Case(".lldbsummaries", lldb::eSectionTypeEmbeddedTypeSummaries) + .Case(".lldbsummaries", lldb::eSectionTypeLLDBTypeSummaries) .Default(eSectionTypeInvalid); if (section_type != eSectionTypeInvalid) return section_type; diff --git a/lldb/source/Symbol/ObjectFile.cpp b/lldb/source/Symbol/ObjectFile.cpp index 74d282154ea97..7ac579b4c3923 100644 --- a/lldb/source/Symbol/ObjectFile.cpp +++ b/lldb/source/Symbol/ObjectFile.cpp @@ -358,7 +358,7 @@ AddressClass ObjectFile::GetAddressClass(addr_t file_addr) { case eSectionTypeSwiftModules: case eSectionTypeDWARFGNUDebugAltLink: case eSectionTypeCTF: - case eSectionTypeEmbeddedTypeSummaries: + case eSectionTypeLLDBTypeSummaries: return AddressClass::eDebug; case eSectionTypeEHFrame: case eSectionTypeARMexidx: diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp index 5825358195532..bddb4d1934a03 100644 --- a/lldb/source/Target/Target.cpp +++ b/lldb/source/Target/Target.cpp @@ -1447,7 +1447,7 @@ static void LoadTypeSummariesForModule(ModuleSP module_sp) { return; auto summaries_sp = - sections->FindSectionByType(eSectionTypeEmbeddedTypeSummaries, true); + sections->FindSectionByType(eSectionTypeLLDBTypeSummaries, true); if (!summaries_sp) return; From c9b83b2a83a012569000706d1275bb5d97050235 Mon Sep 17 00:00:00 2001 From: Dave Lee Date: Mon, 11 Dec 2023 11:06:23 -0800 Subject: [PATCH 9/9] Fixed string name of eSectionTypeLLDBTypeSummaries --- lldb/source/Core/Section.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lldb/source/Core/Section.cpp b/lldb/source/Core/Section.cpp index 1b1d61b8e7244..af5ac21a394bc 100644 --- a/lldb/source/Core/Section.cpp +++ b/lldb/source/Core/Section.cpp @@ -150,7 +150,7 @@ const char *Section::GetTypeAsCString() const { case eSectionTypeCTF: return "ctf"; case eSectionTypeLLDBTypeSummaries: - return "embedded-type-summaries"; + return "lldb-type-summaries"; case eSectionTypeOther: return "regular";