[PATCH] D137882: [DWARFLibrary] Add support to re-construct cu-index

Alexander Yermolovich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 11 18:24:57 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.

This patch originates from the discussion in: https://discourse.llvm.org/t/dwarf-dwp-4gb-limit/63902


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D137882

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: D137882.474912.patch
Type: text/x-patch
Size: 18827 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221112/81e6ade9/attachment.bin>


More information about the llvm-commits mailing list