@@ -1595,34 +1595,6 @@ static lldb::SectionType GetSectionType(uint32_t flags,
1595
1595
static ConstString g_sect_name_objc_classlist (" __objc_classlist" );
1596
1596
static ConstString g_sect_name_cfstring (" __cfstring" );
1597
1597
1598
- static ConstString g_sect_name_dwarf_debug_abbrev (" __debug_abbrev" );
1599
- static ConstString g_sect_name_dwarf_debug_abbrev_dwo (" __debug_abbrev.dwo" );
1600
- static ConstString g_sect_name_dwarf_debug_addr (" __debug_addr" );
1601
- static ConstString g_sect_name_dwarf_debug_aranges (" __debug_aranges" );
1602
- static ConstString g_sect_name_dwarf_debug_cu_index (" __debug_cu_index" );
1603
- static ConstString g_sect_name_dwarf_debug_frame (" __debug_frame" );
1604
- static ConstString g_sect_name_dwarf_debug_info (" __debug_info" );
1605
- static ConstString g_sect_name_dwarf_debug_info_dwo (" __debug_info.dwo" );
1606
- static ConstString g_sect_name_dwarf_debug_line (" __debug_line" );
1607
- static ConstString g_sect_name_dwarf_debug_line_dwo (" __debug_line.dwo" );
1608
- static ConstString g_sect_name_dwarf_debug_line_str (" __debug_line_str" );
1609
- static ConstString g_sect_name_dwarf_debug_loc (" __debug_loc" );
1610
- static ConstString g_sect_name_dwarf_debug_loclists (" __debug_loclists" );
1611
- static ConstString g_sect_name_dwarf_debug_loclists_dwo (" __debug_loclists.dwo" );
1612
- static ConstString g_sect_name_dwarf_debug_macinfo (" __debug_macinfo" );
1613
- static ConstString g_sect_name_dwarf_debug_macro (" __debug_macro" );
1614
- static ConstString g_sect_name_dwarf_debug_macro_dwo (" __debug_macro.dwo" );
1615
- static ConstString g_sect_name_dwarf_debug_names (" __debug_names" );
1616
- static ConstString g_sect_name_dwarf_debug_pubnames (" __debug_pubnames" );
1617
- static ConstString g_sect_name_dwarf_debug_pubtypes (" __debug_pubtypes" );
1618
- static ConstString g_sect_name_dwarf_debug_ranges (" __debug_ranges" );
1619
- static ConstString g_sect_name_dwarf_debug_rnglists (" __debug_rnglists" );
1620
- static ConstString g_sect_name_dwarf_debug_str (" __debug_str" );
1621
- static ConstString g_sect_name_dwarf_debug_str_dwo (" __debug_str.dwo" );
1622
- static ConstString g_sect_name_dwarf_debug_str_offs (" __debug_str_offs" );
1623
- static ConstString g_sect_name_dwarf_debug_str_offs_dwo (" __debug_str_offs.dwo" );
1624
- static ConstString g_sect_name_dwarf_debug_tu_index (" __debug_tu_index" );
1625
- static ConstString g_sect_name_dwarf_debug_types (" __debug_types" );
1626
1598
static ConstString g_sect_name_dwarf_apple_names (" __apple_names" );
1627
1599
static ConstString g_sect_name_dwarf_apple_types (" __apple_types" );
1628
1600
static ConstString g_sect_name_dwarf_apple_namespaces (" __apple_namespac" );
@@ -1637,62 +1609,10 @@ static lldb::SectionType GetSectionType(uint32_t flags,
1637
1609
static ConstString g_sect_name_lldb_formatters (" __lldbformatters" );
1638
1610
static ConstString g_sect_name_swift_ast (" __swift_ast" );
1639
1611
1640
- if (section_name == g_sect_name_dwarf_debug_abbrev)
1641
- return eSectionTypeDWARFDebugAbbrev;
1642
- if (section_name == g_sect_name_dwarf_debug_abbrev_dwo)
1643
- return eSectionTypeDWARFDebugAbbrevDwo;
1644
- if (section_name == g_sect_name_dwarf_debug_addr)
1645
- return eSectionTypeDWARFDebugAddr;
1646
- if (section_name == g_sect_name_dwarf_debug_aranges)
1647
- return eSectionTypeDWARFDebugAranges;
1648
- if (section_name == g_sect_name_dwarf_debug_cu_index)
1649
- return eSectionTypeDWARFDebugCuIndex;
1650
- if (section_name == g_sect_name_dwarf_debug_frame)
1651
- return eSectionTypeDWARFDebugFrame;
1652
- if (section_name == g_sect_name_dwarf_debug_info)
1653
- return eSectionTypeDWARFDebugInfo;
1654
- if (section_name == g_sect_name_dwarf_debug_info_dwo)
1655
- return eSectionTypeDWARFDebugInfoDwo;
1656
- if (section_name == g_sect_name_dwarf_debug_line)
1657
- return eSectionTypeDWARFDebugLine;
1658
- if (section_name == g_sect_name_dwarf_debug_line_dwo)
1659
- return eSectionTypeDWARFDebugLine; // Same as debug_line.
1660
- if (section_name == g_sect_name_dwarf_debug_line_str)
1661
- return eSectionTypeDWARFDebugLineStr;
1662
- if (section_name == g_sect_name_dwarf_debug_loc)
1663
- return eSectionTypeDWARFDebugLoc;
1664
- if (section_name == g_sect_name_dwarf_debug_loclists)
1665
- return eSectionTypeDWARFDebugLocLists;
1666
- if (section_name == g_sect_name_dwarf_debug_loclists_dwo)
1667
- return eSectionTypeDWARFDebugLocListsDwo;
1668
- if (section_name == g_sect_name_dwarf_debug_macinfo)
1669
- return eSectionTypeDWARFDebugMacInfo;
1670
- if (section_name == g_sect_name_dwarf_debug_macro)
1671
- return eSectionTypeDWARFDebugMacro;
1672
- if (section_name == g_sect_name_dwarf_debug_macro_dwo)
1673
- return eSectionTypeDWARFDebugMacInfo; // Same as debug_macro.
1674
- if (section_name == g_sect_name_dwarf_debug_names)
1675
- return eSectionTypeDWARFDebugNames;
1676
- if (section_name == g_sect_name_dwarf_debug_pubnames)
1677
- return eSectionTypeDWARFDebugPubNames;
1678
- if (section_name == g_sect_name_dwarf_debug_pubtypes)
1679
- return eSectionTypeDWARFDebugPubTypes;
1680
- if (section_name == g_sect_name_dwarf_debug_ranges)
1681
- return eSectionTypeDWARFDebugRanges;
1682
- if (section_name == g_sect_name_dwarf_debug_rnglists)
1683
- return eSectionTypeDWARFDebugRngLists;
1684
- if (section_name == g_sect_name_dwarf_debug_str)
1685
- return eSectionTypeDWARFDebugStr;
1686
- if (section_name == g_sect_name_dwarf_debug_str_dwo)
1687
- return eSectionTypeDWARFDebugStrDwo;
1688
- if (section_name == g_sect_name_dwarf_debug_str_offs)
1689
- return eSectionTypeDWARFDebugStrOffsets;
1690
- if (section_name == g_sect_name_dwarf_debug_str_offs_dwo)
1691
- return eSectionTypeDWARFDebugStrOffsetsDwo;
1692
- if (section_name == g_sect_name_dwarf_debug_tu_index)
1693
- return eSectionTypeDWARFDebugTuIndex;
1694
- if (section_name == g_sect_name_dwarf_debug_types)
1695
- return eSectionTypeDWARFDebugTypes;
1612
+ llvm::StringRef stripped_name = section_name.GetStringRef ();
1613
+ if (stripped_name.consume_front (" __debug_" ))
1614
+ return ObjectFile::GetDWARFSectionTypeFromName (stripped_name);
1615
+
1696
1616
if (section_name == g_sect_name_dwarf_apple_names)
1697
1617
return eSectionTypeDWARFAppleNames;
1698
1618
if (section_name == g_sect_name_dwarf_apple_types)
0 commit comments