[PATCH] D159374: [llvm][dwarf][rfc][donotcommit] Enable print of ranges addresses from .debug_info.dwo

Alexander Yermolovich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 1 12:47:28 PDT 2023


ayermolo created this revision.
Herald added subscribers: hoy, modimo, wenlei, cmtice, 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.

For split dwarf some of the sections remain in the main binary. For DWARF4 it's
.debug_ranges, .debug_addr. For DWARF5 it's .debug_addr. When using
llvm-dwarfdump on .dwo/.dwp files this results in not being able to see what ranges
and addresses for DW_AT_low_pc are used in DIEs, and output having "Error: " in it.

I added a new option --main-binary=<binary> that will create a link in
DWARFContext between DWO context and main binary. This allows tool to display
addresses for DW_AT_ranges and DW_AT_low_pc.

Example (DWARF5):
DW_TAG_inlined_subroutine
	DW_AT_abstract_origin (0x00000b21 "flush_RL")

  DW_AT_ranges  (indexed (0x0) rangelist = 0x00000054
  	[0x0000000000403fe2, 0x0000000000403ff3)
    [0x0000000000403ff6, 0x0000000000403ffe))

DW_TAG_subprogram

  DW_AT_low_pc  (0x0000000000403940)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D159374

Files:
  llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h
  llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
  llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp
  llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D159374.555470.patch
Type: text/x-patch
Size: 8412 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230901/70b704a1/attachment.bin>


More information about the llvm-commits mailing list