[Lldb-commits] [PATCH] D32167: Add support for type units (.debug_types) to LLDB in a way that is compatible with DWARF 5

Adrian Prantl via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Apr 18 15:17:16 PDT 2017


aprantl added inline comments.


================
Comment at: packages/Python/lldbsuite/test/make/Makefile.rules:197
+ifeq "$(DWARF_TYPE_UNITS)" "YES"
+	DEBUG_INFO_FLAG ?= -gdwarf-4
+else
----------------
This shouldn't be necessary on any platform LLDB cares about. DWARF 4 should be the default everywhere.


================
Comment at: packages/Python/lldbsuite/test/plugins/builder_base.py:204
+        commands.append([getMake(), "clean", getCmdLine(dictionary)])
+    commands.append([getMake(), "MAKE_DSYM=NO", "DWARF_TYPE_UNITS=YES",
+                    getArchSpec( architecture), getCCSpec(compiler),
----------------
Why does the type unit configuration care about whether there are dsyms or not? Shouldn't this be orthogonal?


================
Comment at: packages/Python/lldbsuite/test/test_categories.py:27
     'gmodules': 'Tests that can be run with -gmodules debug information',
+    'dwarf_type_units' : 'Tests using the DWARF type units (-fdebug-types-section)',
     'expression': 'Tests related to the expression parser',
----------------
This is conflating two things (-fdebug-types-section and type units) DWARF5 doesn't have a debug_types section but it still offers type units. Clang doesn't implement this yet, but GCC might, I haven't checked.


================
Comment at: source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp:1109
+DWARFDIE DWARFCompileUnit::FindTypeSignatureDIE(uint64_t type_sig) const {
+  auto cu = m_dwarf2Data->DebugInfo()->GetTypeUnitForSignature(type_sig);
+  if (cu)
----------------
if (auto cu = ...)


================
Comment at: source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp:1116
+dw_offset_t DWARFCompileUnit::FindTypeSignatureDIEOffset(uint64_t type_sig) const {
+  auto cu = m_dwarf2Data->DebugInfo()->GetTypeUnitForSignature(type_sig);
+  if (cu)
----------------
if (auto cu = ...)


================
Comment at: source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h:169
 
+  // Return true if this compile unit is a type unit.
+  bool IsTypeUnit() const { return m_type_offset != DW_INVALID_OFFSET; }
----------------
/// everywhere?


================
Comment at: source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.h:51
+  /// section as compile units and type units are in the .debug_info.
+  //------------------------------------------------------------------
+  void OffsetData(lldb::offset_t offset)
----------------
I think the //--- line might confuse Doxygen, but I'm not sure.


================
Comment at: source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp:121
+        if (!cu_sp)
+          break;
+        
----------------
Is that check common LLDB style?


https://reviews.llvm.org/D32167





More information about the lldb-commits mailing list