summaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
diff options
context:
space:
mode:
authorAlex Langford <alangford@apple.com>2023-08-29 14:11:41 -0700
committerAlex Langford <alangford@apple.com>2023-08-31 15:16:12 -0700
commit764287f1ad69469cc264bb094e8fcdcfdd0fcdfb (patch)
tree6f224b734744e38062a100c42d737b433292fb47 /lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
parentdfc0ede1f889fbd8bf6dfca0e479ee70495786ab (diff)
[lldb] Add support for recognizing swift ast sections in object files
In Apple's downstream fork, there is support for understanding the swift AST sections in various binaries. Even though the lldb on llvm.org does not have support for debugging swift, I think it makes sense to move support for recognizing swift ast sections upstream. Differential Revision: https://reviews.llvm.org/D159142
Diffstat (limited to 'lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp')
-rw-r--r--lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
index 3e52c9e3c042..3ce2057d5372 100644
--- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
+++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
@@ -1202,6 +1202,7 @@ AddressClass ObjectFileMachO::GetAddressClass(lldb::addr_t file_addr) {
case eSectionTypeDWARFAppleObjC:
case eSectionTypeDWARFGNUDebugAltLink:
case eSectionTypeCTF:
+ case eSectionTypeSwiftModules:
return AddressClass::eDebug;
case eSectionTypeEHFrame:
@@ -1476,6 +1477,7 @@ static lldb::SectionType GetSectionType(uint32_t flags,
static ConstString g_sect_name_data("__data");
static ConstString g_sect_name_go_symtab("__gosymtab");
static ConstString g_sect_name_ctf("__ctf");
+ static ConstString g_sect_name_swift_ast("__swift_ast");
if (section_name == g_sect_name_dwarf_debug_abbrev)
return eSectionTypeDWARFDebugAbbrev;
@@ -1555,6 +1557,8 @@ static lldb::SectionType GetSectionType(uint32_t flags,
return eSectionTypeGoSymtab;
if (section_name == g_sect_name_ctf)
return eSectionTypeCTF;
+ if (section_name == g_sect_name_swift_ast)
+ return eSectionTypeSwiftModules;
if (section_name == g_sect_name_objc_data ||
section_name == g_sect_name_objc_classrefs ||
section_name == g_sect_name_objc_superrefs ||