Skip to content

Commit dd99b9f

Browse files
jasonmolendagithub-actions[bot]
authored andcommitted
Automerge: [lldb][Mach-O] Fix DWARF5 debugging regression for Mach-O
A unification of the DWARF section names, llvm/llvm-project#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.
2 parents 78364a6 + f5733b0 commit dd99b9f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1595,6 +1595,8 @@ static lldb::SectionType GetSectionType(uint32_t flags,
15951595
static ConstString g_sect_name_objc_classlist("__objc_classlist");
15961596
static ConstString g_sect_name_cfstring("__cfstring");
15971597

1598+
static ConstString g_sect_name_dwarf_debug_str_offs("__debug_str_offs");
1599+
static ConstString g_sect_name_dwarf_debug_str_offs_dwo("__debug_str_offs.dwo");
15981600
static ConstString g_sect_name_dwarf_apple_names("__apple_names");
15991601
static ConstString g_sect_name_dwarf_apple_types("__apple_types");
16001602
static ConstString g_sect_name_dwarf_apple_namespaces("__apple_namespac");
@@ -1609,6 +1611,11 @@ static lldb::SectionType GetSectionType(uint32_t flags,
16091611
static ConstString g_sect_name_lldb_formatters("__lldbformatters");
16101612
static ConstString g_sect_name_swift_ast("__swift_ast");
16111613

1614+
if (section_name == g_sect_name_dwarf_debug_str_offs)
1615+
return eSectionTypeDWARFDebugStrOffsets;
1616+
if (section_name == g_sect_name_dwarf_debug_str_offs_dwo)
1617+
return eSectionTypeDWARFDebugStrOffsetsDwo;
1618+
16121619
llvm::StringRef stripped_name = section_name.GetStringRef();
16131620
if (stripped_name.consume_front("__debug_"))
16141621
return ObjectFile::GetDWARFSectionTypeFromName(stripped_name);

0 commit comments

Comments
 (0)