[PATCH] Add basic find-debuginfo script tests

Mark Wielaard mark@klomp.org
Fri Jun 13 13:11:02 GMT 2025


Hi Martin,

On Fri, 2025-06-13 at 11:01 +0200, Martin Cermak wrote:
> On  Fri  2025-06-13  00:43 , Mark Wielaard wrote:
> > Covers basic find-debuginfo script functionality. Checks .debug files
> > are generated by eu-strip, .gnu_debugdata is generated, .gdb_index is
> > added by gdb-add-index, dwz multi file is created and all debugsources
> > are found.
> [...]
> 
> This does work for me.  The patch applies cleanly on top of
> currently latest 1a2cef32e5face9fc943c0b11759c6e8c7e0c765, and
> with this patch:
> 
> Using gdb-14.2-4.1.el10_0.x86_64 and dwz-0.15-7.el10.x86_64 all
> tests are green.  After upgrading to gdb-16.3-2.el10.x86_64, the
> newly added 37: find-debuginfo run FAILED (find-debuginfo.at:90)
> 
> I can also reproduce by gcc hello.c  -g -o hello; gdb-add-index
> ./hello; eu-readelf -S hello | fgrep index; dwz hello; eu-readelf
> -S hello | fgrep index.  This also shows how the .gdb_index
> section is added, but then will vanish after applying dwz in case
> gdb-16 was used.
> 
> So this does work for me as expected.

Thanks for testing. I also ran it over the try buildbots. It seems to
work as expected, but there were some issues:

- debugedit-try-ubuntu-riscv
  Uses dwz 0.15 (without patches) and GDB 15.0.50.20240403-git
  This triggers a failure:
./find-debuginfo.at:90: $READELF -S usr/lib/debug/subdir_build/foo.debug | grep gdb_index
stdout:
./find-debuginfo.at:90: exit code was 1, expected 0

Expected since gdb 15+ generates gdb_index version 9 and plain dwz 0.15
doesn't support that. Maybe we should upgrade the ubuntu-riscv
buildbots to dwz 0.16? It is somewhat unfortunate that Ubuntu 24.04.1
LTS uses incompatible gdb and dwz versions.

- debugedit-try-fedora-clang-x86_64
  Uses CC=clang to produce the binaries and debuginfo.
  This triggers a failure:
+dwz: ./subdir_build/bar.debug: Unknown debugging section .debug_addr
+dwz: ./subdir_build/baz.debug: Unknown debugging section .debug_addr
+dwz: ./subdir_build/foo.debug: Unknown debugging section .debug_addr
+dwz: Too few files for multifile optimization

dwz does indeed not support .debug_addr sections:
https://sourceware.org/bugzilla/show_bug.cgi?id=27375
Might need a AT_SKIP_IF based on some configure check for presence of
.debug_addr?

- debugedit-try-opensusetw-x86_64
- debugedit-try-opensuseleap-x86_64
- debugedit-try-fedora-arm64
+*** ERROR: DWARF compression requested, but no dwz installed

I'll add dwz to those containers/vms.

Cheers,

Mark


More information about the Debugedit mailing list