gdb.base/corefile-buildid.exp: fix DUPLICATEs when failing to generate a core file

When my system isn't properly configured to generate core files in the
local directory, I see these DUPLICATEs:

    DUPLICATE: gdb.base/corefile-buildid.exp: could not generate core file

Fix that by having a single with_test_prefix around that message and
what follows.

Change-Id: I4ac245fcce1c666db56e3bad3582aa17f183dcba
This commit is contained in:
Simon Marchi
2021-11-30 21:00:59 -05:00
parent 360ef3b94a
commit 6976b5b961

View File

@ -257,6 +257,7 @@ proc do_corefile_buildid_tests {args} {
lappend suffix "sepdebug"
}
with_test_prefix "[join $suffix \ ]" {
# Find the core file.
set corefile [core_find $program_to_run]
if {$corefile == ""} {
@ -268,20 +269,19 @@ proc do_corefile_buildid_tests {args} {
# Grab the build-id from the binary, removing ".debug" from the end.
set buildid [build_id_debug_filename_get $program_to_run]
if {$buildid == ""} {
untested "binary for [join $suffix \ ] has no build-id"
untested "binary has no build-id"
}
regsub {\.debug$} $buildid {} buildid
verbose -log "build-id is $buildid"
with_test_prefix "[join $suffix \ ]" {
locate_exec_from_core_build_id $corefile $buildid \
[join $suffix -] $sepdebug false $shared
}
with_test_prefix "symlink [join $suffix \ ]" {
with_test_prefix "symlink" {
locate_exec_from_core_build_id $corefile $buildid \
[join $suffix -] $sepdebug true $shared
}
}
}
# Directories where executables will be moved before testing.