[PATCH] D71006: [llvm/DWARF] Return section offset from DWARFUnit::get{Loc,Rng}listOffset

Pavel Labath via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 4 05:11:35 PST 2019


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

Currently these function return the raw content of the appropriate table
header, which means they are relative to the DW_AT_{loc,rng}list_base,
and one has to relocate them in order to do anything.

This changes the functions to perform the relocation themselves, which
seems more clearer, particularly as they are sitting right next to the
find{Rng,Loc}listFromOffset functions, but one *cannot* simply take the
result of these functions and take pass them there.

The only effect of this patch is to change what value is dumped for the
DW_AT_ranges attribute, which I think is for the better, as previously
the values appeared to point into thin air.

(The main reason I am looking at this is because I was trying to
implement equivalent functionality in lldb's DWARFUnit, and was stumped
by this behavior.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D71006

Files:
  llvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h
  llvm/lib/DebugInfo/DWARF/DWARFDie.cpp
  llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp
  llvm/test/DebugInfo/X86/dwarfdump-rnglists-dwarf64.s
  llvm/test/DebugInfo/X86/dwarfdump-rnglists.s
  llvm/test/DebugInfo/X86/split-dwarf-v5-ranges.ll
  llvm/test/tools/llvm-dwarfdump/X86/no_debug_addr.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71006.232092.patch
Type: text/x-patch
Size: 5431 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191204/68c76055/attachment.bin>


More information about the llvm-commits mailing list