jankratochvil updated this revision to Diff 143475.
jankratochvil retitled this revision from "DWZ 04/11: Support reading section 
".gnu_debugaltlink"" to "DWZ 01/07: Support reading section 
".gnu_debugaltlink"".
jankratochvil added a comment.

It is now reworked without `FileOffset` and the remapping to unique DIE offsets 
for each `DW_TAG_partial_unit` inclusion by `DW_TAG_imported_unit`, as 
discussed in: 
https://lists.llvm.org/pipermail/lldb-commits/Week-of-Mon-20180409/040324.html


https://reviews.llvm.org/D40468

Files:
  include/lldb/lldb-enumerations.h
  source/Core/Section.cpp
  source/Expression/IRExecutionUnit.cpp
  source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
  source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
  source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
  source/Symbol/ObjectFile.cpp

Index: source/Symbol/ObjectFile.cpp
===================================================================
--- source/Symbol/ObjectFile.cpp
+++ source/Symbol/ObjectFile.cpp
@@ -363,6 +363,7 @@
           case eSectionTypeDWARFAppleTypes:
           case eSectionTypeDWARFAppleNamespaces:
           case eSectionTypeDWARFAppleObjC:
+          case eSectionTypeDWARFGNUDebugAltLink:
             return eAddressClassDebug;
           case eSectionTypeEHFrame:
           case eSectionTypeARMexidx:
Index: source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
===================================================================
--- source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
+++ source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
@@ -134,7 +134,7 @@
               eSectionTypeDWARFDebugMacInfo,  eSectionTypeDWARFDebugPubNames,
               eSectionTypeDWARFDebugPubTypes, eSectionTypeDWARFDebugRanges,
               eSectionTypeDWARFDebugStr,      eSectionTypeDWARFDebugStrOffsets,
-              eSectionTypeELFSymbolTable,
+              eSectionTypeELFSymbolTable,     eSectionTypeDWARFGNUDebugAltLink,
           };
           for (size_t idx = 0; idx < sizeof(g_sections) / sizeof(g_sections[0]);
                ++idx) {
Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
===================================================================
--- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
+++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
@@ -250,6 +250,7 @@
   const lldb_private::DWARFDataExtractor &get_apple_types_data();
   const lldb_private::DWARFDataExtractor &get_apple_namespaces_data();
   const lldb_private::DWARFDataExtractor &get_apple_objc_data();
+  const lldb_private::DWARFDataExtractor &get_gnu_debugaltlink();
 
   DWARFDebugAbbrev *DebugAbbrev();
 
@@ -495,6 +496,7 @@
   DWARFDataSegment m_data_apple_types;
   DWARFDataSegment m_data_apple_namespaces;
   DWARFDataSegment m_data_apple_objc;
+  DWARFDataSegment m_data_gnu_debugaltlink;
 
   // The unique pointer items below are generated on demand if and when someone
   // accesses
Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===================================================================
--- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -681,6 +681,11 @@
   return GetCachedSectionData(eSectionTypeDWARFAppleObjC, m_data_apple_objc);
 }
 
+const DWARFDataExtractor &SymbolFileDWARF::get_gnu_debugaltlink() {
+  return GetCachedSectionData(eSectionTypeDWARFGNUDebugAltLink,
+                              m_data_gnu_debugaltlink);
+}
+
 DWARFDebugAbbrev *SymbolFileDWARF::DebugAbbrev() {
   if (m_abbr.get() == NULL) {
     const DWARFDataExtractor &debug_abbrev_data = get_debug_abbrev_data();
Index: source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
===================================================================
--- source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
+++ source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
@@ -1212,6 +1212,7 @@
           case eSectionTypeDWARFAppleTypes:
           case eSectionTypeDWARFAppleNamespaces:
           case eSectionTypeDWARFAppleObjC:
+          case eSectionTypeDWARFGNUDebugAltLink:
             return eAddressClassDebug;
 
           case eSectionTypeEHFrame:
Index: source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
===================================================================
--- source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -1823,6 +1823,7 @@
       static ConstString g_sect_name_arm_exidx(".ARM.exidx");
       static ConstString g_sect_name_arm_extab(".ARM.extab");
       static ConstString g_sect_name_go_symtab(".gosymtab");
+      static ConstString g_sect_name_dwarf_gnu_debugaltlink(".gnu_debugaltlink");
 
       SectionType sect_type = eSectionTypeOther;
 
@@ -1913,6 +1914,8 @@
         sect_type = eSectionTypeARMextab;
       else if (name == g_sect_name_go_symtab)
         sect_type = eSectionTypeGoSymtab;
+      else if (name == g_sect_name_dwarf_gnu_debugaltlink)
+        sect_type = eSectionTypeDWARFGNUDebugAltLink;
 
       const uint32_t permissions =
           ((header.sh_flags & SHF_ALLOC) ? ePermissionsReadable : 0u) |
Index: source/Expression/IRExecutionUnit.cpp
===================================================================
--- source/Expression/IRExecutionUnit.cpp
+++ source/Expression/IRExecutionUnit.cpp
@@ -1100,6 +1100,7 @@
   case lldb::eSectionTypeDWARFAppleTypes:
   case lldb::eSectionTypeDWARFAppleNamespaces:
   case lldb::eSectionTypeDWARFAppleObjC:
+  case lldb::eSectionTypeDWARFGNUDebugAltLink:
     error.Clear();
     break;
   default:
Index: source/Core/Section.cpp
===================================================================
--- source/Core/Section.cpp
+++ source/Core/Section.cpp
@@ -117,6 +117,8 @@
     return "go-symtab";
   case eSectionTypeAbsoluteAddress:
     return "absolute";
+  case eSectionTypeDWARFGNUDebugAltLink:
+    return "dwarf-gnu-debugaltlink";
   case eSectionTypeOther:
     return "regular";
   }
Index: include/lldb/lldb-enumerations.h
===================================================================
--- include/lldb/lldb-enumerations.h
+++ include/lldb/lldb-enumerations.h
@@ -656,6 +656,7 @@
   eSectionTypeGoSymtab,
   eSectionTypeAbsoluteAddress, // Dummy section for symbols with absolute
                                // address
+  eSectionTypeDWARFGNUDebugAltLink,
   eSectionTypeOther
 };
 
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to