]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite] Fix gdb.base/list-dot-nodebug.exp on openSUSE
authorTom de Vries <tdevries@suse.de>
Tue, 4 Feb 2025 09:34:39 +0000 (10:34 +0100)
committerTom de Vries <tdevries@suse.de>
Tue, 4 Feb 2025 09:34:39 +0000 (10:34 +0100)
On openSUSE Leap 15.6 with test-case gdb.base/list-dot-nodebug.exp I run into:
...
(gdb) list .^M
warning: 1      ../sysdeps/x86_64/crtn.S: No such file or directory^M
(gdb) FAIL: $exp: debug=none: print before start
...

The intent of the debug=none case is to generate an executable with no debug
info.  However, we have quite a few CUs with debug info:
...
$ readelf -wi outputs/gdb.base/list-dot-nodebug/list-dot-nodebug-none \
    | egrep -c " @ "
431
...

This is because this code:
...
  gdb_gnu_strip_debug $executable no-debuglink
...
uses $executable, and the variable is set here:
...
set executable ${testfile}-none
...
which sets it to "list-dot-nodebug-none" and consequently
gdb_gnu_strip_debug cannot find it.

Fix this by using "[standard_output_file $executable]" instead.

Tested on x86_64-linux.

Approved-By: Tom Tromey <tom@tromey.com>
PR testsuite/31721
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31721

gdb/testsuite/gdb.base/list-dot-nodebug.exp

index b7359be1a45f49806edb037d27d53412ed180149..107669de04d9f3032e74306d951e76b3f3890770 100644 (file)
@@ -55,7 +55,7 @@ foreach_with_prefix debug {"none" "some"} {
 
        # Stripping is a backup in case the system has static libc debuginfo.
        # We can continue the test even if it fails.
-       gdb_gnu_strip_debug $executable no-debuglink
+       gdb_gnu_strip_debug [standard_output_file $executable] no-debuglink
 
        clean_restart ${executable}