diff options
author | Jason Molenda <jmolenda@apple.com> | 2025-06-09 17:40:10 -0700 |
---|---|---|
committer | Jason Molenda <jmolenda@apple.com> | 2025-06-09 17:42:31 -0700 |
commit | f5733b0b859ada51ab4a1cc239ce901ea30b297f (patch) | |
tree | 7a215d041ca14a7368ea3219ac3758f95cb6ff44 /lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp | |
parent | 3e6a704b5fe33aa0e25cc482199985368a8ee6cf (diff) | |
download | llvm-f5733b0b859ada51ab4a1cc239ce901ea30b297f.zip llvm-f5733b0b859ada51ab4a1cc239ce901ea30b297f.tar.gz llvm-f5733b0b859ada51ab4a1cc239ce901ea30b297f.tar.bz2 |
[lldb][Mach-O] Fix DWARF5 debugging regression for Mach-O
A unification of the DWARF section names,
https://github.com/llvm/llvm-project/pull/141344
broke dwarf5 debugging with Mach-O files. The str_offset and
str_offset.dwo names are different in Mach-O from other object
files.
Diffstat (limited to 'lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp')
-rw-r--r-- | lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp index cbfebdbe..b174192 100644 --- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp @@ -1595,6 +1595,8 @@ static lldb::SectionType GetSectionType(uint32_t flags, static ConstString g_sect_name_objc_classlist("__objc_classlist"); static ConstString g_sect_name_cfstring("__cfstring"); + static ConstString g_sect_name_dwarf_debug_str_offs("__debug_str_offs"); + static ConstString g_sect_name_dwarf_debug_str_offs_dwo("__debug_str_offs.dwo"); static ConstString g_sect_name_dwarf_apple_names("__apple_names"); static ConstString g_sect_name_dwarf_apple_types("__apple_types"); static ConstString g_sect_name_dwarf_apple_namespaces("__apple_namespac"); @@ -1609,6 +1611,11 @@ static lldb::SectionType GetSectionType(uint32_t flags, static ConstString g_sect_name_lldb_formatters("__lldbformatters"); static ConstString g_sect_name_swift_ast("__swift_ast"); + if (section_name == g_sect_name_dwarf_debug_str_offs) + return eSectionTypeDWARFDebugStrOffsets; + if (section_name == g_sect_name_dwarf_debug_str_offs_dwo) + return eSectionTypeDWARFDebugStrOffsetsDwo; + llvm::StringRef stripped_name = section_name.GetStringRef(); if (stripped_name.consume_front("__debug_")) return ObjectFile::GetDWARFSectionTypeFromName(stripped_name); |