[PATCH] D137657: [DWARFLibrary] Add support re-constructing cu-index

Alexander Yermolovich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 8 09:58:03 PST 2022


ayermolo created this revision.
Herald added subscribers: hoy, modimo, wenlei, cmtice, arphaman, hiraditya.
Herald added a reviewer: jhenderson.
Herald added a project: All.
ayermolo requested review of this revision.
Herald added subscribers: llvm-commits, MaskRay.
Herald added a project: LLVM.

According to DWARF5 specification and gnu specification for DWARF4 the offset
entry in the CU/TU Index is 32 bits. This presents a problem when
.debug_info.dwo in DWP file grows beyond 4GB. The CU Index becomes partially
corrupted.

This diff adds manual parsing of .debug_info.dwo/.debug_abbrev.dwo to
reconstruct CU index in general, and TU index for DWARF5. This is a work around
until DWARF6 spec is finalized.

Next patch will change internal CU/TU struct to 64 bit, and change uses as
necessary. The plan is to land all the patches in one go after all are approved.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D137657

Files:
  llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h
  llvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h
  llvm/include/llvm/DebugInfo/DWARF/DWARFUnitIndex.h
  llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
  llvm/lib/DebugInfo/DWARF/DWARFUnitIndex.cpp
  llvm/test/tools/llvm-dwp/X86/debug_macro_v5.s
  llvm/test/tools/llvm-dwp/X86/info-v5.s
  llvm/test/tools/llvm-dwp/X86/loclists.s
  llvm/test/tools/llvm-dwp/X86/rnglists.s
  llvm/test/tools/llvm-dwp/X86/tu_units_v5.s
  llvm/test/tools/llvm-dwp/X86/type_dedup.test
  llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D137657.474039.patch
Type: text/x-patch
Size: 22286 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221108/862329e9/attachment.bin>


More information about the llvm-commits mailing list