[PATCH] D123538: [symbolizer] Parse DW_TAG_variable DIs to show line info for globals

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 11 22:56:01 PDT 2022


jhenderson added a reviewer: dblaikie.
jhenderson added a subscriber: dblaikie.
jhenderson added a comment.

I think this needs a doc update?

FYI: I've not looked at the parts of this patch that are in DebugInfo/DWARF. Someone with more familiarity with the area should probably review it (I can if nobody else is around - adding @dblaikie who may be a good shout).



================
Comment at: llvm/test/tools/llvm-symbolizer/data-location.s:16
+################################################################################
+## File below was generated using:
+##   $ clang -g -fuse-ld=lld -shared /tmp/file.c -o out.so && obj2yaml out.so
----------------
One of the purposes of the cross-project-tests project was to make it  easier to test llvm-symbolizer without having to resort to canned binaries or canned YAML blobs like below. By writing the test there, you can use clang and lld directly and consequently start from a much more understandable .c file.

That being said, I wonder if you'd be better off hand-crafting this YAML. It doesn't seem likely to be that complicated to write some .debug_info that has the property you want using yaml2obj's DWARF support, if I follow the required behaviour correctly. There are already some good examples of similar bits. The advantage with using yaml like that is that you can keep it tightly focused on what is important, omitting the various components of the object that are unrelated to the test (e.g. .eh_frame).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123538/new/

https://reviews.llvm.org/D123538



More information about the llvm-commits mailing list