]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb/testsuite: tests for debug lookup within the sysroot
authorAndrew Burgess <aburgess@redhat.com>
Sat, 18 May 2024 09:50:23 +0000 (10:50 +0100)
committerAndrew Burgess <aburgess@redhat.com>
Tue, 4 Jun 2024 12:33:31 +0000 (13:33 +0100)
commit3e35b4deae28d3653226403452328c680ef7f5b2
tree065ce3ee8b936c6316b0e0d9115c416b7ba22faa
parent9543c37620c9483f77f0f728f32e6517987c7b4c
gdb/testsuite: tests for debug lookup within the sysroot

Add tests for looking up debug information within the sysroot via both
build-id and gnu_debuglink.

I wanted to ensure that the gnu_debuglink test couldn't make use of
build-ids, so I added the 'no-build-id' flag to gdb_compile.

As these tests rely on setting the sysroot, if I'm running a
dynamically linked executable, GDB will try to find all shared
libraries within the sysroot.  This would mean I'd have to figure out
and copy all shared libraries the executable uses, certainly possible,
but a bit of a pain.

So instead, I've just compiled the test executable as a static binary.
Now there are no shared library dependencies.

I can now split the debug information out from the test binary, and
place it within the sysroot.  When GDB is started and the executable
loaded, we can check that GDB is finding the debug information within
the sysroot.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31804

Approved-By: Tom de Vries <tdevries@suse.de>
gdb/testsuite/gdb.base/sysroot-debug-lookup.exp [new file with mode: 0644]
gdb/testsuite/lib/gdb.exp