[Lldb-commits] [PATCH] D81334: [lldb] Fix DW_TAG_GNU_call_site-DW_AT_low_pc as produced by GCC

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Jun 8 03:13:37 PDT 2020

labath added a comment.

Thanks for tracking this down, and for creating a nice test case. I think the implementation would be cleaner with a new argument, as per the inline comment.

Comment at: lldb/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.h:113
-  size_t GetAttributes(DWARFAttributes &attributes, uint32_t depth = 0) const;
+  size_t GetAttributes(DWARFAttributes &attributes, int32_t depth = 0) const;
Using -1 to prevent recursion is pretty unobvious. I think it would be better to add a `bool recurse = true` argument between `attributes` and `depth`. In fact, I'd consider even deleting the `depth` argument -- it's an internal detail that noone except `DWARFDebugInfoEntry` should be using and the single usage there can be easily changed to `spec_die.GetDIE()->GetAttributes(spec_die.GetUnit(), attributes, recurse, depth+1)`

Comment at: lldb/test/Shell/SymbolFile/DWARF/DW_TAG_GNU_call_site-DW_AT_low_pc.s:14
+# RUN: %clang_host -o %t %s
+# RUN: %lldb %t -o 'b 6' -o r -o 'p p' -o exit | FileCheck %s
Maybe place an int3 at the place where you want this to stop? Then you can delete all of the line table directives and the break location will be more obvious...

  rG LLVM Github Monorepo



More information about the lldb-commits mailing list