[PATCH] D68270: DWARFDebugLoc: Add a function to get the address range of an entry

Pavel Labath via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 1 07:22:01 PDT 2019


labath created this revision.
labath added reviewers: JDevlieghere, dblaikie, probinson.
Herald added a subscriber: aprantl.
Herald added a project: LLVM.

Interpreting a .debug_loclists entry is not completely trivial [citation
needed]. This patch creates a function which can be used by any
libDebugInfo user (thinking of LLDB mainly) to get the range of an
entry.

The debug_loclists parser already contained a partial implementation of
that in the dump function. This implementation is replaced by a call to
the new "getRange" function, and it falls back to printing of raw data
in case we fail to get the address range.

Because LLDB is not fully converted to llvm's debug info parser, I
provide two getRange signatures: one takes a DWARFUnit*, which is used
to resolve .debug_addr references; and one which delegates this job to a
user-supplied callback.

I add a more thorough test of debug_loclists dumping capabilities. In
writing this test, I discovered that we're not able to handle
relocations in the debug_loclists section. However, fixing this was not
completely straight-forward, so I left a TODO, and will address that in
a separate patch.


Repository:
  rL LLVM

https://reviews.llvm.org/D68270

Files:
  include/llvm/BinaryFormat/Dwarf.h
  include/llvm/DebugInfo/DWARF/DWARFDebugLoc.h
  lib/BinaryFormat/Dwarf.cpp
  lib/DebugInfo/DWARF/DWARFDebugLoc.cpp
  test/DebugInfo/X86/fission-ranges.ll
  test/DebugInfo/X86/loclists-dwp.ll
  test/tools/llvm-dwarfdump/X86/debug_loc_dwo.s
  test/tools/llvm-dwarfdump/X86/debug_loclists.s
  test/tools/llvm-dwarfdump/X86/debug_loclists_startx_length.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68270.222607.patch
Type: text/x-patch
Size: 17597 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191001/0b05761c/attachment.bin>


More information about the llvm-commits mailing list