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

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Feb 26 10:29:41 PST 2018


labath added a comment.

So, I tried this out on my machine, and got just one failure:

  ======================================================================
  FAIL: test_with_run_command_dwarf_type_units (TestInlinedBreakpoints.InlinedBreakpointsTestCase)
     Test 'b basic_types.cpp:176' does break (where int.cpp includes basic_type.cpp).
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File "/usr/local/google/home/labath/ll/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 1827, in dwarf_type_units_test_method
      return attrvalue(self)
    File "/usr/local/google/home/labath/ll/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/inlined_breakpoints/TestInlinedBreakpoints.py", line 24, in test_with_run_command
      self.inlined_breakpoints()
    File "/usr/local/google/home/labath/ll/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/inlined_breakpoints/TestInlinedBreakpoints.py", line 46, in inlined_breakpoints
      self, "basic_type.cpp", self.line, num_expected_locations=0)
    File "/usr/local/google/home/labath/ll/lldb/packages/Python/lldbsuite/test/lldbutil.py", line 376, in run_break_set_by_file_and_line
      num_locations=num_expected_locations)
    File "/usr/local/google/home/labath/ll/lldb/packages/Python/lldbsuite/test/lldbutil.py", line 572, in check_breakpoint_result
      out_num_locations))
  AssertionError: False is not True : Expecting 0 locations, got 1.

However, I am not so sure about the proliferation of debug info variants that we seem to be having. Right now we have two outstanding patches wanting to add a debug variant, which would bring the total amount of variants per test to 6. I'm not sure this is a tractable way forward.
IIUC, clang only puts "non-trivial" types in type units. I'm not sure how many of our tests even define classes/structs (i.e., for how many tests this debug info variant would actually be testing something new).



================
Comment at: source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h:194
+  //------------------------------------------------------------------
+  bool IsTypeUnit() const { return m_type_offset != DW_INVALID_OFFSET; }
+  //------------------------------------------------------------------
----------------
It seems weird to have an IsTypeUnit method on a compile unit, when a dwarf compile unit is clearly not a type unit. Would some of the refactors that Jan is doing (I haven't looked at those too closely as it's not really my area, but I know he is adding a DwarfUnit class) help with this?


https://reviews.llvm.org/D32167





More information about the lldb-commits mailing list