]> git.ipfire.org Git - thirdparty/elfutils.git/commit
readelf: print .debug_cu_index and .debug_tu_index sections
authorMark Wielaard <mark@klomp.org>
Mon, 23 Mar 2026 18:01:53 +0000 (19:01 +0100)
committerMark Wielaard <mark@klomp.org>
Wed, 1 Apr 2026 14:53:13 +0000 (16:53 +0200)
commit7f8cb736643b0d51296f19999a9e2b4e2671d1d2
tree3f7ce50a9740ab322ca6ce44eeb34f56f170c9a6
parent4a3c74869abbc3a863df5316f31f2dede816fa78
readelf: print .debug_cu_index and .debug_tu_index sections

DWARF Package files (.dwp) might contain a .debug_cu_index and/or
.debug_tu_index section. Print the contents of these sections. Handles
version 2 (DWARF4 + GNU Debugfission extension), version 5
(standardized) and version 6 (prelimenary, adds 64bit offsets).  Use
the existing dwp4 and dwp5 testfiles.

* src/readelf.c (options): Add cu_index to debug-dump docs.
(section_e): Add section_cu_index.
(section_all): Likewise.
(parse_opt): handle "cu_index" arg for debug-dump.
(dwarf_section_short_string): New static function.
(print_cu_index_section): Likewise.
(print_debug): Move up implicit_info and explicit_info. Only
search for skeleton file if .debug_info is needed. Handle both
.debug_cu_index and .debug_tu_index through
print_cu_index_section.
* tests/run-readelf-cu-index.sh: New test.
* tests/Makefile.am (TESTS): Add run-readelf-cu-index.sh.
(EXTRA_DIST): Likewise.

Signed-off-by: Mark Wielaard <mark@klomp.org>
src/readelf.c
tests/Makefile.am
tests/run-readelf-cu-index.sh [new file with mode: 0755]