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

Mitch Phillips via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 11 12:58:38 PDT 2022


hctim created this revision.
hctim added reviewers: echristo, cmtice.
Herald added subscribers: rupprecht, hiraditya, emaste.
Herald added a reviewer: jhenderson.
Herald added a project: All.
hctim requested review of this revision.
Herald added subscribers: llvm-commits, MaskRay.
Herald added a project: LLVM.

Currently, llvm-symbolizer doesn't like to parse .debug_info in order to
show the line info for global variables. addr2line does this. In the
future, I'm looking to migrate AddressSanitizer off of internal metadata
over to using debuginfo, and this is predicated on being able to get the
line info for global variables.

This patch adds the requisite support for getting the line info from the
.debug_info section for symbolizing global variables. This only happens
when you ask for a global variable to be symbolized as data.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D123538

Files:
  llvm/include/llvm/DebugInfo/DIContext.h
  llvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h
  llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
  llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp
  llvm/lib/DebugInfo/Symbolize/DIPrinter.cpp
  llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp
  llvm/test/DebugInfo/Symbolize/ELF/data-command-symtab.yaml
  llvm/test/tools/llvm-symbolizer/data-location.s
  llvm/test/tools/llvm-symbolizer/data.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D123538.422014.patch
Type: text/x-patch
Size: 24184 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220411/2fdf193b/attachment.bin>


More information about the llvm-commits mailing list