]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
[gdb/testsuite] Fix build-id check in gdb.python/py-missing-objfile.exp
authorTom de Vries <tdevries@suse.de>
Thu, 4 Dec 2025 09:29:52 +0000 (10:29 +0100)
committerTom de Vries <tdevries@suse.de>
Thu, 4 Dec 2025 09:29:52 +0000 (10:29 +0100)
commitb52c9bb8929a0f7010e2cec5cc16562d01a84de3
tree20264103378e0557172e2cfbac75fca9edb580f4
parentbfaa4d5816f5ee5bee9699b6b9354e60e52be58b
[gdb/testsuite] Fix build-id check in gdb.python/py-missing-objfile.exp

I recently added two requires in test-case gdb.python/py-missing-objfile.exp:
...
# The following tests assume that the build-ids of binfile and libfile can be
# found in the core file.
require {expect_build_id_in_core_file $binfile}
require {expect_build_id_in_core_file $libfile}
...

However, at the point where the check is done, the files are no longer
available at that location, which makes the require fail.

First, make the problem visible, by making proc expect_build_id_in_core_file
throw an error if the filename argument specifies a non-existing file.

Then, fix test-case gdb.python/py-missing-objfile.exp by moving the calls to
expect_build_id_in_core_file to a point where the files exist.

Tested on x86_64-linux.
gdb/testsuite/gdb.python/py-missing-objfile.exp
gdb/testsuite/lib/gdb.exp