[PATCH] D48009: [DWARF/AccelTable] Remove getDIESectionOffset for DWARF v5 entries

Pavel Labath via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 11 04:36:05 PDT 2018


labath created this revision.
labath added reviewers: JDevlieghere, aprantl, dblaikie.
Herald added a subscriber: mgrang.

This method was not correct for entries in DWO files as it assumed it
could just add up the CU and DIE offsets to get the absolute DIE offset.
This is not correct for the DWO files, as here the CU offset will
reference the skeleton unit, whereas the DIE offset will be the offset
in the full unit in the DWO file.

Unfortunately, this means that we are not able to determine the absolute
DIE offset using the information in the .debug_names section alone,
which means we have to offload some of this work to the users of this
class.

To demonstrate how this can be done, I've added/fixed the ability to
lookup entries using accelerator tables in DWO files in llvm-dwarfdump.
To make this happen, I've needed to make two extra changes in other
classes:

- made the DWARFContext method to lookup a CU based on the section offset public. I've needed this functionality to lookup a CU, and this seems like a useful thing in general.
- made DWARFUnit::getDWOId call extractDIEsIfNeeded. Before this, the DWOId was filled in only if the root DIE happened to be parsed before we called the accessor. Since the lazy parsing is supposed to happen under the hood, calling extractDIEsIfNeeded seems appropriate.


Repository:
  rL LLVM

https://reviews.llvm.org/D48009

Files:
  include/llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h
  include/llvm/DebugInfo/DWARF/DWARFContext.h
  include/llvm/DebugInfo/DWARF/DWARFUnit.h
  lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp
  lib/DebugInfo/DWARF/DWARFVerifier.cpp
  test/tools/llvm-dwarfdump/X86/debug-names-find-dwo.s
  tools/llvm-dwarfdump/llvm-dwarfdump.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48009.150707.patch
Type: text/x-patch
Size: 15906 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180611/cc0965b7/attachment.bin>


More information about the llvm-commits mailing list