[gdb/testsuite] Fix gdb.base/catch-syscall.exp without --enable-targets
authorTom de Vries <tdevries@suse.de>
Wed, 11 May 2022 11:30:33 +0000 (13:30 +0200)
committerTom de Vries <tdevries@suse.de>
Wed, 11 May 2022 11:30:33 +0000 (13:30 +0200)
When doing a gdb build without --enable-targets, I run into:
...
(gdb) UNSUPPORTED: gdb.base/catch-syscall.exp: multiple targets: \
  s390:31-bit vs s390:64-bit: set architecture s390:64-bit
delete breakpoints^M
(gdb) info breakpoints^M
No breakpoints or watchpoints.^M
(gdb) break -qualified main^M
No symbol table is loaded.  Use the "file" command.^M
Make breakpoint pending on future shared library load? (y or [n]) n^M
(gdb) FAIL: gdb.base/catch-syscall.exp: gdb_breakpoint: set breakpoint at main
...

The problem is that due to recent commit e21d8399303 ("[gdb/testsuite] Remove
target limits in gdb.base/catch-syscall.exp") "clean_restart $binfile" no
longer is called at the end of test_catch_syscall_multi_arch.

Fix this by moving "clean_restart $binfile" back to
test_catch_syscall_multi_arch.

Tested on x86_64-linux.

gdb/testsuite/gdb.base/catch-syscall.exp

index fed0e7b774c35905fd5cf4168fb51cb0ede4229e..1260a64270f5ccc201e0376eb1a6c6fae25762fd 100644 (file)
@@ -568,7 +568,7 @@ proc test_catch_syscall_with_wrong_args_noxml {} {
 proc test_catch_syscall_multi_arch_1 {
   arch1 arch2 syscall1_name syscall2_name syscall_number
 } {
-    global decimal binfile
+    global decimal
 
     with_test_prefix "multiple targets: $arch1 vs $arch2" {
        # We are not interested in loading any binary here, and in
@@ -605,12 +605,12 @@ proc test_catch_syscall_multi_arch_1 {
        gdb_test "catch syscall $syscall_number" \
            "Catchpoint $decimal \\(syscall .${syscall2_name}. \\\[${syscall_number}\\\]\\)" \
            "insert catch syscall on syscall $syscall_number -- $syscall2_name on $arch2"
-
-       clean_restart $binfile
     }
 }
 
 proc test_catch_syscall_multi_arch {} {
+    global binfile
+
     set arch1 "i386"
     set arch2 "i386:x86-64"
     set syscall1_name "exit"
@@ -650,6 +650,8 @@ proc test_catch_syscall_multi_arch {} {
     set syscall_number 142
     test_catch_syscall_multi_arch_1 $arch1 $arch2 $syscall1_name \
        $syscall2_name $syscall_number
+
+    clean_restart $binfile
 }
 
 proc do_syscall_tests_without_xml {} {