]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
GDB: testsuite: base: Don't return value from top-level (manual)
authorThiago Jung Bauermann <thiago.bauermann@linaro.org>
Wed, 29 Apr 2026 23:04:06 +0000 (20:04 -0300)
committerThiago Jung Bauermann <thiago.bauermann@linaro.org>
Fri, 8 May 2026 21:55:58 +0000 (18:55 -0300)
This patch manually changes "return -1" and "return 0" statements that
weren't caught by the sed command.

These return statements fall into one of these criteria:

- misaligned line, which is then fixed by this patch;
- return at top level but inside a block such as save_vars,
  with_test_prefix, foreach, gdb_test_multiple.

Some weren't changed because they didn't meet the criteria above, or
weren't trivial to check.

There was also one return statement with an unnecessary semi-colon at
the end, which was removed.

Approved-By: Tom Tromey <tom@tromey.com>
77 files changed:
gdb/testsuite/gdb.base/argv0-symlink.exp
gdb/testsuite/gdb.base/async-shell.exp
gdb/testsuite/gdb.base/attach-pie-misread.exp
gdb/testsuite/gdb.base/bigcore.exp
gdb/testsuite/gdb.base/bp-cmds-continue-ctrl-c.exp
gdb/testsuite/gdb.base/bp-cmds-run-with-ex.exp
gdb/testsuite/gdb.base/branch-to-self.exp
gdb/testsuite/gdb.base/break-always.exp
gdb/testsuite/gdb.base/bt-on-error-and-warning.exp
gdb/testsuite/gdb.base/bt-on-fatal-signal.exp
gdb/testsuite/gdb.base/catch-fork-kill.exp
gdb/testsuite/gdb.base/catch-syscall.exp
gdb/testsuite/gdb.base/checkpoint.exp
gdb/testsuite/gdb.base/code_elim.exp
gdb/testsuite/gdb.base/compare-sections.exp
gdb/testsuite/gdb.base/cond-eval-mode.exp
gdb/testsuite/gdb.base/condbreak-bad.exp
gdb/testsuite/gdb.base/continue-all-already-running.exp
gdb/testsuite/gdb.base/coredump-filter.exp
gdb/testsuite/gdb.base/corefile-exec-context.exp
gdb/testsuite/gdb.base/corefile-find-exec.exp
gdb/testsuite/gdb.base/cvexpr.exp
gdb/testsuite/gdb.base/detach.exp
gdb/testsuite/gdb.base/disabled-location.exp
gdb/testsuite/gdb.base/dmsym.exp
gdb/testsuite/gdb.base/dso2dso.exp
gdb/testsuite/gdb.base/endianity.exp
gdb/testsuite/gdb.base/foll-exec-mode.exp
gdb/testsuite/gdb.base/fullname.exp
gdb/testsuite/gdb.base/fullpath-expand.exp
gdb/testsuite/gdb.base/gcore-relro.exp
gdb/testsuite/gdb.base/gcore.exp
gdb/testsuite/gdb.base/gcorebg.exp
gdb/testsuite/gdb.base/global-var-nested-by-dso.exp
gdb/testsuite/gdb.base/gnu-ifunc.exp
gdb/testsuite/gdb.base/gnu_vector.exp
gdb/testsuite/gdb.base/huge.exp
gdb/testsuite/gdb.base/info-fun.exp
gdb/testsuite/gdb.base/info-proc.exp
gdb/testsuite/gdb.base/info-shared.exp
gdb/testsuite/gdb.base/interp.exp
gdb/testsuite/gdb.base/jit-reader-simple.exp
gdb/testsuite/gdb.base/jump.exp
gdb/testsuite/gdb.base/label.exp
gdb/testsuite/gdb.base/longjmp.exp
gdb/testsuite/gdb.base/moribund-step.exp
gdb/testsuite/gdb.base/nostdlib.exp
gdb/testsuite/gdb.base/overlays.exp
gdb/testsuite/gdb.base/printcmds.exp
gdb/testsuite/gdb.base/random-signal.exp
gdb/testsuite/gdb.base/randomize.exp
gdb/testsuite/gdb.base/readline-ask.exp
gdb/testsuite/gdb.base/readline.exp
gdb/testsuite/gdb.base/readnever.exp
gdb/testsuite/gdb.base/relocate.exp
gdb/testsuite/gdb.base/reread.exp
gdb/testsuite/gdb.base/return2.exp
gdb/testsuite/gdb.base/setshow.exp
gdb/testsuite/gdb.base/solib-abort.exp
gdb/testsuite/gdb.base/solib-bad-entry-addr.exp
gdb/testsuite/gdb.base/solib-display.exp
gdb/testsuite/gdb.base/solib-overlap.exp
gdb/testsuite/gdb.base/solib-search.exp
gdb/testsuite/gdb.base/solib-symbol.exp
gdb/testsuite/gdb.base/stale-infcall.exp
gdb/testsuite/gdb.base/step-break.exp
gdb/testsuite/gdb.base/step-line.exp
gdb/testsuite/gdb.base/step-test.exp
gdb/testsuite/gdb.base/style-logging.exp
gdb/testsuite/gdb.base/testenv.exp
gdb/testsuite/gdb.base/traced-thread.exp
gdb/testsuite/gdb.base/valgrind-bt.exp
gdb/testsuite/gdb.base/valgrind-infcall.exp
gdb/testsuite/gdb.base/vdso-warning.exp
gdb/testsuite/gdb.base/watchpoint.exp
gdb/testsuite/gdb.base/wchar.exp
gdb/testsuite/gdb.base/wrong_frame_bt_full.exp

index 6b05bba205d6dcf6bb69f524c6d4941fb69c674d..58d5ef98fc4405b1f526fc9d70e309421f5187e4 100644 (file)
@@ -42,13 +42,13 @@ with_test_prefix "file symlink" {
                    "ln -sf ${testfile} [standard_output_file $filelink]"]
     if {[lindex $status 0] != 0} {
        unsupported "$test (host does not support symbolic links)"
-       return 0
+       return
     }
 
     clean_restart "$filelink"
 
     if {![runto_main]} {
-       return -1
+       return
     }
 
     gdb_test_no_output "set print repeats 10000"
@@ -82,13 +82,13 @@ with_test_prefix "dir symlink" {
     set status [remote_exec host "ln -sf . [standard_output_file $dirlink]"]
     if {[lindex $status 0] != 0} {
        unsupported "$test (host does not support symbolic links)"
-       return 0
+       return
     }
 
     clean_restart "$dirlink/$filelink"
 
     if {![runto_main]} {
-       return -1
+       return
     }
 
     gdb_test_no_output "set print repeats 10000"
index 72f3645a757eecd8dcd8b7585e87e04d30ee1c54..28003fa92d3d623ed09a8506f34f9c0a3dd1075c 100644 (file)
@@ -23,7 +23,7 @@ require !use_gdb_stub
 save_vars { GDBFLAGS } {
     set GDBFLAGS "$GDBFLAGS -ex \"set non-stop on\""
     if { [prepare_for_testing "failed to prepare" ${testfile} $srcfile] } {
-       return -1
+       return
     }
 }
 
index a8002119d962416efa17b8b13f878e5f89f6bbf0..d2decd801fc3931c37fd28a36ffe0559c465fee0 100644 (file)
@@ -99,7 +99,7 @@ with_test_prefix "rebuild with DGEN defined" {
     set prelink_args [build_executable_own_libs ${testfile}.exp $executable $srcfile \
                          [list pie "additional_flags=-DGEN=\"$genfile\""]]
     if {$prelink_args == ""} {
-       return -1
+       return
     }
 }
 
index 7dd88108235479ca94e430e6e7d55c8bc21b27bd..b1ced340fc11f7eae0991716b22317f23ba7c21b 100644 (file)
@@ -39,8 +39,8 @@ standard_testfile .c
 set corefile [standard_output_file ${binfile}.corefile]
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-     untested "failed to compile"
-     return -1
+    untested "failed to compile"
+    return
 }
 
 # Traverse part of bigcore's linked list of memory chunks (forward or
index 368507b2409cb222d78c5f2a14c2bbe2a52f3892..9fac9b551b32945e261e191addbaf3bb5c3bf56c 100644 (file)
@@ -121,7 +121,7 @@ with_test_prefix "run" {
     clean_restart $testfile
 
     if {![runto_main]} {
-       return -1
+       return
     }
 
     do_test
index 95c2811a3e03d8cd55bef5744d75d02ecb08e4ed..1bdb75f44fd0a27c31ca687ddb943bcc0fbc25e2 100644 (file)
@@ -35,7 +35,7 @@ save_vars { GDBFLAGS } {
     gdb_exit
     if {[gdb_spawn] != 0} {
        fail "spawn gdb"
-       return -1
+       return
     }
 }
 
index ffd15780d72420293219e89c005b21541359aa50..2cb388219e015f378e151f2ea7db8c37f024db60 100644 (file)
@@ -28,7 +28,7 @@ with_test_prefix "single-step" {
 
     clean_restart ${testfile}
     if {![runto_main]} {
-       return -1
+       return
     }
     set line_num [gdb_get_line_number "loop-line" ${testfile}.c]
 
@@ -61,7 +61,7 @@ with_test_prefix "break-cond" {
        clean_restart ${testfile}
 
        if {![runto_main]} {
-           return -1
+           return
        }
 
        set test "set breakpoint condition-evaluation $side"
index f2eb1a3ba8b9fcf75e13d0f915fe673d17601247..8fe3fb3f863da261e8b01bef8508a01c8f8145b2 100644 (file)
@@ -78,7 +78,7 @@ foreach test_value {0 1} {
            # Some targets do not allow manually writing a breakpoint to a
            # certain memory address, like QEMU.  In that case, just bail out.
            unsupported "cannot write to address $bp_address"
-           return -1
+           return
        }
        -re " = .*$gdb_prompt $" {
            pass $write_test
index a9a1db344d21b348ae8c631f710f2a83a65ac30a..0873ce5728c4bd0e61c27f6f5ab4e9116b7fce71 100644 (file)
@@ -37,7 +37,7 @@ gdb_test_multiple "maint set internal-error backtrace on" \
     "check backtrace is supported" {
     -re "support for this feature is not compiled into GDB" {
        untested "feature not supported"
-       return -1
+       return
     }
     -re "$gdb_prompt $" {
        pass $gdb_test_name
index 9bf5f09c566f25c91406a43a3e166b43dedc1b89..67511741d395ebd18005bf9802a2e06ec2204e48 100644 (file)
@@ -42,7 +42,7 @@ if {![runto_main]} {
 gdb_test_multiple "maint set backtrace-on-fatal-signal on" "" {
     -re "support for this feature is not compiled into GDB" {
        untested $testfile
-       return -1
+       return
     }
     -re "$gdb_prompt $" {
        pass $gdb_test_name
index 498e34a49bec77d563b530bae6186fe8c64c6547..cd541e66247cbd52fa1e8a7a134bd7ac5965e05a 100644 (file)
@@ -44,7 +44,7 @@ foreach kind {"fork" "vfork"} {
     if {[build_executable $testfile.exp $testfile ${srcfile} \
             ${compile_options}] == -1} {
        untested "failed to compile"
-       return -1
+       return
     }
 }
 
index 673fca4a9984ce5475ffc68faa6ca9f178e10bb1..63abc1aec809bf447b1f168e2b2693c11c6c7d36 100644 (file)
@@ -24,7 +24,7 @@ require supports_catch_syscall
 standard_testfile
 
 if  { [prepare_for_testing "failed to prepare" $testfile ${testfile}.c] } {
-     return -1
+    return
 }
 
 if {![runto_main]} {
index b6ea9f63f1703c377223661cdca14e73613f4e58..828a633d4a46684536bf572c262194c6dbcf4447 100644 (file)
@@ -38,7 +38,7 @@ if {[is_remote host]} {
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
         [list debug "additional_flags=-DPI_TXT=\"$pi_txt\" -DCOPY1_TXT=\"$copy1_txt\""]]} {
-     return -1
+    return
 }
 
 global gdb_prompt
index 15e59b9095bb858ae25e9aff00d63738f0ab5227..7c79ff54f196b34ad0ea3921df3cec6f02f063e6 100644 (file)
@@ -38,12 +38,12 @@ remote_exec build "rm -f ${binfile2}"
 
 if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile1}" executable $opts] != "" } {
      untested "failed to compile"
-     return -1
+    return
 }
 
 if { [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${binfile2}" executable $opts] != "" } {
      untested "failed to compile"
-     return -1
+    return
 }
 
 proc not_null_var_address { var } {
index bf6207061778e8c09af5f2c88df8aa6a16e266b8..ba2687dbcb8486479f2f58ab65768e8daa22249e 100644 (file)
@@ -117,7 +117,7 @@ with_test_prefix "read-only" {
 
     if {!$has_ro_sections} {
        unsupported "no read-only sections"
-       return -1;
+       return
     }
 
     set orig -1
@@ -132,7 +132,7 @@ with_test_prefix "read-only" {
 
     if {$orig == -1} {
        untested "couldn't read address of read-only section"
-       return -1
+       return
     }
 
     # Come up with different value.
@@ -153,7 +153,7 @@ with_test_prefix "read-only" {
 
     if { $written != $patch } {
        unsupported "can't patch read-only section"
-       return -1
+       return
     }
 
     gdb_test "compare-sections -r" \
index e9463950eb54a83aa8b71f0259bcd49b543f22c6..c2aefc4a93b65b574800d886873bb6c850cbac82 100644 (file)
@@ -47,7 +47,7 @@ set warning "warning: Target does not support breakpoint condition evaluation.\r
 gdb_test_multiple $test_target $test_target {
     -re "$warning\r\n$gdb_prompt $" {
        unsupported $test_target
-       return -1
+       return
     }
 
     -re "^$test_target\r\n$gdb_prompt $" {
index 216b485b635612236477396cc2b825d2ed8f70a0..7ee32bdb40bbd6e739f4eff9207ed2fc3dbe58ce 100644 (file)
@@ -67,7 +67,7 @@ with_test_prefix "with run" {
 # deletes the breakpoints.
 with_test_prefix "with continue 1" {
     if {![runto_main]} {
-       return -1
+       return
     }
 
     gdb_breakpoint "$bp_location"
@@ -87,7 +87,7 @@ with_test_prefix "with continue 1" {
 # Repeat with a condition that evaluates to false.
 with_test_prefix "with continue 2" {
     if {![runto_main]} {
-       return -1
+       return
     }
 
     gdb_breakpoint "$bp_location"
@@ -107,7 +107,7 @@ with_test_prefix "with continue 2" {
 # Repeat with a condition that contains junk at the end.
 with_test_prefix "with junk" {
     if {![runto_main]} {
-       return -1
+       return
     }
 
     gdb_breakpoint "$bp_location"
index 734b5e9681bbe6726a8d0f87041102a20340f221..65d9073e74e1bee00b2bc3323678c607870ab357 100644 (file)
@@ -21,7 +21,7 @@ standard_testfile
 save_vars { GDBFLAGS } {
     set GDBFLAGS "$GDBFLAGS -ex \"set non-stop on\""
     if { [prepare_for_testing "failed to prepare" ${testfile} $srcfile] } {
-       return -1
+       return
     }
 }
 
index 6bf26f1643abd9e626095c29103ef293ceab0da2..26bf2ebed50ea6ef805d3ab938dd5e3674e228b5 100644 (file)
@@ -194,7 +194,7 @@ gdb_test_multiple "info inferiors" "getting inferior pid" {
        # If the target does not provide PID information (like usermode QEMU),
        # just bail out as the rest of the test may rely on it, giving spurious
        # failures.
-       return -1
+       return
     }
 }
 
index 8c342171cecf85dee58224294bc325dfbc1e0956..9b018533b68ea27b4044ed6979a466ee38b7d094 100644 (file)
@@ -147,7 +147,7 @@ save_vars { ::env($env_var_name) } {
     set corefile [core_find $binfile {} $args]
     if {$corefile == ""} {
        untested "unable to create corefile"
-       return 0
+       return
     }
 }
 set corefile_3 "$binfile.2.core"
index 7d79b70c41b768f8daa77724e056cab3bced98b5..7219d32e4cb3d6fb9f26f8b31e4a4a4afea17fe0 100644 (file)
@@ -65,7 +65,7 @@ with_test_prefix "absolute path" {
        set corefile [core_find $binfile]
        if {$corefile == ""} {
            untested "unable to create corefile"
-           return 0
+           return
        }
        set corefile_1 "$binfile.1.core"
        remote_exec build "mv $corefile $corefile_1"
@@ -86,7 +86,7 @@ with_test_prefix "absolute path" {
        set corefile [core_find $symlink]
        if {$corefile == ""} {
            untested "unable to create corefile"
-           return 0
+           return
        }
        set corefile_2 "$binfile.2.core"
        remote_exec build "mv $corefile $corefile_2"
@@ -108,7 +108,7 @@ with_test_prefix "absolute path" {
        set corefile [core_find $symlink]
        if {$corefile == ""} {
            untested "unable to create corefile"
-           return 0
+           return
        }
        set corefile_3 "$binfile.3.core"
        remote_exec build "mv $corefile $corefile_3"
@@ -142,7 +142,7 @@ with_test_prefix "absolute path" {
        set corefile [core_find $binfile_2]
        if {$corefile == ""} {
            untested "unable to create corefile"
-           return 0
+           return
        }
        set corefile_4 "$binfile.4.core"
        remote_exec build "mv $corefile $corefile_4"
@@ -216,7 +216,7 @@ with_test_prefix "relative path" {
            set corefile [core_find $rel_path_to_file]
            if {$corefile == ""} {
                untested "unable to create corefile"
-               return 0
+               return
            }
            set corefile_5 "${work_dir}/${testfile}.5.core"
            remote_exec build "mv $corefile $corefile_5"
@@ -230,7 +230,7 @@ with_test_prefix "relative path" {
            set corefile [core_find $rel_path_to_symlink_2]
            if {$corefile == ""} {
                untested "unable to create corefile"
-               return 0
+               return
            }
            set corefile_6 "${work_dir}/${testfile}.6.core"
            remote_exec build "mv $corefile $corefile_6"
index a726b1a71bf4c4751c57952f12b3e8fb2a6a0ad0..f556d38803b5afa10ca1f9d0712eaf95f76a41a3 100644 (file)
@@ -518,7 +518,7 @@ foreach testspec $specs {
 # These tests don't rely on the debug format.
 with_test_prefix nodebug {
     if { [prepare_for_testing "failed to prepare" $testfile $srcfile {nodebug}] } {
-       return 0
+       return
     }
 
     gdb_test "ptype _Atomic int" "type = _Atomic int"
index be5afddc1f8f225a1e221a859e6bb97f7ab380bc..b8b1ce91dde670224d213043af9e3f4bcd1f30c5 100644 (file)
@@ -19,7 +19,7 @@
 
 # Only GNU/Linux is known to support this.
 if { ! [istarget "*-*-linux*"] } {
-  return 0
+    return
 }
 
 standard_testfile attach.c
index 17e8987ded18af6a67a48060c1f209f0c4f3dc9f..3a5c2f344779058e228fd601af6bc9c6bdd8296b 100644 (file)
@@ -20,7 +20,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile}] } {
 }
 
 if {![runto_main]} {
-   return 0
+    return
 }
 
 gdb_test "break function" \
index 3820b13bfdc7c8dcdbd67431b35402df6abf727b..6b02b97014ded21bf9978aaabf0763bb8816a5f7 100644 (file)
@@ -26,8 +26,8 @@ set dmsym_o [standard_output_file dmsym.o]
 if {[gdb_compile "${srcdir}/${subdir}/dmsym.c" \
                 $dmsym_o \
                 object {}] != ""} {
-  untested "failed to compile object file"
-  return -1
+    untested "failed to compile object file"
+    return
 }
 
 if {[gdb_compile \
index 1e7e633d18274b954202d555baa7c6ae6d21f1c5..6f8962b0309ac9abc6b32e346082a1ba5caabff0 100644 (file)
@@ -49,14 +49,14 @@ if { [build_executable "build shlib 2" $binfile_libdso2 \
 
 if { [prepare_for_testing "prepare" $testfile $srcfile \
          [list debug shlib=$binfile_libdso2 shlib=$binfile_libdso1]] != 0 } {
-  return
+    return
 }
 
 gdb_load_shlib $binfile_libdso2
 gdb_load_shlib $binfile_libdso1
 
 if { ![runto_main] } {
-  return -1
+    return
 }
 
 set bp_location [gdb_get_line_number "STOP HERE" [file tail $srcfile_libdso1]]
index 0da319a824cd91608964a6be8c801e0fc57f908b..e82f31f29854be69ae1f0158c44aa8357e0556a8 100644 (file)
@@ -21,12 +21,12 @@ set test_sso [expr \
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
          [list debug additional_flags=-DTEST_SSO=$test_sso]] } {
-  return -1
+    return
 }
 
 set bp_location [gdb_get_line_number "START"]
 if {![runto "endianity.c:$bp_location"]} {
-  return -1
+    return
 }
 
 gdb_test "print o" "= {v = 3, w = 2, x = 7, f = 23.5, cplx = 1.25 \\+ 7.25i, d = 75}" \
index c3f5390ca5c2105e7bad1aaa22cb080111874809..6fa076ada2a7371bea7a16a3bfa743500c231ee7 100644 (file)
@@ -47,13 +47,13 @@ set compile_options debug
 
 # build the first test case
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${binfile2}" executable $compile_options] != "" } {
-      untested "failed to compile"
-      return -1
+    untested "failed to compile"
+    return
 }
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable $compile_options] != "" } {
-      untested "failed to compile"
-      return -1
+    untested "failed to compile"
+    return
 }
 
 #  Test exec catchpoints to ensure exec events are supported.
index 7f46cb56d8588b5c4e7e558376baf253cabfb8ec..30969248d56c5a8576502dee9bacfb8301e15580 100644 (file)
@@ -95,7 +95,7 @@ if { [gdb_breakpoint [standard_output_file tmp-${srcfile}]:${line} {no-message}]
 with_cwd [standard_output_file {}] {
     if  { [gdb_compile [standard_output_file tmp-${srcfile}] "${testfile}" \
               executable {debug}] != "" } {
-       return -1
+       return
     }
 }
 
index 053eb9b59f0a5de730375c0bbefe928e56000000..e7f96c1e7a5bbed28c9ae61cdfd7e8fa8aa99182 100644 (file)
@@ -29,7 +29,7 @@ with_cwd $srcdir {
 
     if { $err != "" } {
        untested "${srcfile} or ${srcfile2} compilation failed"
-       return -1
+       return
     }
 }
 
index 59bd37f93acc34cd7b572355217cbb38a0767afb..70b6daff29365e2af0b1a9e970e3c21d88ea3f8b 100644 (file)
@@ -24,13 +24,13 @@ set objfile [standard_output_file ${testfile}.o]
 
  if { [gdb_compile_shlib ${srcdir}/${subdir}/${srcfile_lib} ${binfile_lib} {debug}] != ""
       || [gdb_compile ${srcdir}/${subdir}/${srcfile} ${objfile} object {debug}] != "" } {
-      untested "failed to compile"
-      return -1
+     untested "failed to compile"
+     return
  }
  set opts [list debug shlib=${binfile_lib} ldflags=-Wl,-z,relro]
  if { [gdb_compile ${objfile} ${binfile} executable $opts] != "" } {
-      unsupported "-Wl,-z,relro compilation failed"
-      return -1
+     unsupported "-Wl,-z,relro compilation failed"
+     return
  }
 
 with_test_prefix "first session" {
@@ -38,11 +38,11 @@ with_test_prefix "first session" {
     gdb_load_shlib ${binfile_lib}
 
     if {![runto lib]} {
-       return -1
+       return
     }
 
     if {![gdb_gcore_cmd $gcorefile "save a corefile"]} {
-       return -1
+       return
     }
 }
 
index aa887b0da14d3fd8ddee6947e42d66b9bdeb8b54..243e0b39082bb5720a628ebaa1a60e678bc5d6f1 100644 (file)
@@ -54,7 +54,7 @@ set pre_corefile_extern_array \
 set corefile [standard_output_file gcore.test]
 set core_supported [gdb_gcore_cmd "$corefile" "save a corefile"]
 if {!$core_supported} {
-  return -1
+    return
 }
 
 # Now restart gdb and load the corefile.
index 8724794b607a4de2e0b38f2e8d1cfb6c32008ec6..67436dedb43a034b3a195ddacbc199ae17900f9b 100644 (file)
@@ -26,7 +26,7 @@ require can_spawn_for_attach
 set corefile [standard_output_file ${testfile}.core]
 
 if {[build_executable "failed to build" $testfile ${srcfile}] == -1 } {
-     return -1
+    return
 }
 
 # Cleanup.
index 5fca2345f6afd1e6dc0477a2fe7614293ef72ba3..164f60b25793f187c76745aa3a59d5b1d4ccebe9 100644 (file)
@@ -45,7 +45,7 @@ gdb_load_shlib $binfile_lib1
 gdb_load_shlib $binfile_lib2
 
 if { ![runto_main] } {
-  return -1
+    return
 }
 
 gdb_test "next" "$decimal.*b_main \\(\\);" "step over c_main"
index 2c1dffeeece16c76f08f7f2a377fde8abc11f0ab..d6a50a9b6862d927e58e28ac2cf333348b0a76fc 100644 (file)
@@ -393,7 +393,7 @@ with_test_prefix "static" {
         || [gdb_compile "${srcdir}/${subdir}/$srcfile $lib_o $final_o" \
                 $staticbinfile executable {debug}] != "" } {
        untested "failed to compile second testcase"
-       return -1
+       return
     }
 
     clean_restart $staticexecutable
index b92d82c3428c9e03a0aa571834f09993f8aa231e..36724d1e9786fabbfa091c643fcb2626e6afe475 100644 (file)
@@ -36,8 +36,8 @@ if { [do_compile {-mcpu=native}] != ""
      && [do_compile {-mcpu=native -Wno-psabi}] != ""
      && [do_compile {-march=native}] != ""
      && [do_compile] != ""} {
-       untested "compiler can't handle vector_size attribute?"
-       return -1
+    untested "compiler can't handle vector_size attribute?"
+    return
 }
 
 clean_restart $testfile
index 4ddfceebd9e50651032db9a7dcd761542b928f52..98c081b557ab1bcd992968ba39e9c317f9459f89 100644 (file)
@@ -46,7 +46,7 @@ clean_restart $testfile
 
 with_timeout_factor 3 {
     if {![runto_main]} {
-       return -1
+       return
     }
 
     gdb_test_no_output "set max-value-size unlimited"
index c2f9ae03152a51984498a8f4bf1cedba76983b76..1465220d3db431d2d3634139cccef45bd9339b14 100644 (file)
@@ -38,7 +38,7 @@ foreach_with_prefix n_flag { 0 1 } {
             || [gdb_compile $srcdir/$subdir/${srcfile} ${binfile} \
                     executable $bin_flags] != "" } {
            untested "failed to compile"
-           return -1
+           return
        }
 
        if {$libsepdebug == "SEP"} {
@@ -53,7 +53,7 @@ foreach_with_prefix n_flag { 0 1 } {
        clean_restart $executable
 
        if {![runto_main]} {
-           return 0
+           return
        }
 
        set match_str {All functions matching regular expression "foo":[\r\n]*}
index f1b435e249f369c3fafdadf0385edbdb934fc0cf..89eed2ac815a9d1d063407fa8b8c0aa20c2638e4 100644 (file)
@@ -27,7 +27,7 @@ save_vars { env(GDB_INFO_PROC_ENVIRON_1) } {
 
     if {[prepare_for_testing "failed to prepare" $testfile \
             [list $srcfile $srcfile2] {debug nowarnings}]} {
-       return -1
+       return
     }
 }
 
@@ -40,7 +40,7 @@ gdb_test_multiple "info proc" "info proc without a process" {
     -re "Not supported on this target.*$gdb_prompt $" {
        # info proc command not supported -- nothing to test here.
        unsupported "gdb does not support info proc on this target"
-       return -1
+       return
     }
 }
 
index 993e64f64a271301238eaf84613eddcdeacf314e..5e740f2a3ee58f26e9027bd9961332c073f134cc 100644 (file)
@@ -160,7 +160,7 @@ with_test_prefix styled {
 
        gdb_test_no_output "set style enabled off"
        if {![runto_main]} {
-           return 0
+           return
        }
        gdb_breakpoint "stop"
        gdb_continue_to_breakpoint "library load #1" "\\.?stop .*"
index d19d0e3ceca65d6823a845f0f802d40d871dc2c0..516c1507657eb8ed1e46e15b3632388382acef04 100644 (file)
@@ -82,7 +82,7 @@ gdb_test "$commands\nend" "" "finish defining hello command"
 gdb_test "hello" [string_to_regexp "^done,value=\"23\""]
 
 if {![runto_main]} {
-  return -1
+    return
 }
 
 gdb_test "list" ".*\[0-9\].*main \\(int argc.*" "can list sources"
index 445e2b053fd2e12e1c6089e3ae4726ca2e4a8dea..a50a92b6c504d20c33533bfc81eb181162f4030b 100644 (file)
@@ -181,7 +181,7 @@ with_test_prefix "two JITers" {
     gdb_load $binfile_dl2
 
     if {![runto_main]} {
-       return -1
+       return
     }
 
     set num_bps 0
index 3139b081aa255b219ea2e5d68633d689bbfd9672..63b145dbf5e45f81ca3c0537208d7433faee6c03 100644 (file)
@@ -110,7 +110,7 @@ for {set inf 2} {$inf <= $num_inferiors} {incr inf} {
        "Switching to inferior ${inf} .*" \
        "switch to inferior ${inf}"
     if {![runto_main]} {
-       return -1
+       return
     }
 }
 
index 418841961c8d2ccddad92daf0be1d10e75fe5e40..647f1551d51166625ba4cb3592645c5762a301cb 100644 (file)
@@ -25,7 +25,7 @@ if { [prepare_for_testing "failed to prepare" $testfile ${srcfile} debug] } {
 
 
 if {![runto_main]} {
-  return -1
+    return
 }
 
 gdb_test "break -q here" \
index 92b9544021fa58138f3afddac3e381206f277856..c895799938a35db0c22d3117e99d02d8b8513c4b 100644 (file)
@@ -21,8 +21,8 @@
 standard_testfile .c
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] != "" } {
-     untested "failed to compile"
-     return -1
+    untested "failed to compile"
+    return
 }
 
 proc do_test { with_probes } {
index 79acb0a543cc37a7c5909ddb6456329981385885..134a9032192a98cc90673bd2796627875a84370c 100644 (file)
@@ -20,7 +20,7 @@ require support_displaced_stepping
 save_vars { GDBFLAGS } {
     set GDBFLAGS "$GDBFLAGS -ex \"set non-stop on\""
     if { [prepare_for_testing "failed to prepare" ${testfile} $srcfile] } {
-       return -1
+       return
     }
 }
 
index 91a3de3fa235974d1b2366163a084b6ab3c06702..920f145d628842a4b7277890090fcfc50b9d4ca3 100644 (file)
@@ -49,7 +49,7 @@ foreach_with_prefix pie { "nopie" "pie" } {
     }
     if {$err != ""} {
        untested "failed to compile"
-       return -1
+       return
     }
 
     clean_restart $filename
index 1cb452b77142fa593bfc88ba55ab222f293e5f11..0d11726d4df597edaba90d07e8921481fda4d834 100644 (file)
@@ -29,8 +29,8 @@ standard_testfile overlays.c ovlymgr.c foo.c bar.c baz.c grbx.c
 if {[build_executable $testfile.exp $testfile \
         [list $srcfile $srcfile2 $srcfile3 $srcfile4 $srcfile5 $srcfile6] \
         "debug ldscript=-Wl,-T$linker_script"] == -1} {
-     untested "failed to compile"
-     return -1
+    untested "failed to compile"
+    return
 }
 
 remote_exec build "mv ${testfile}.o foo.o bar.o baz.o grbx.o ovlymgr.o ${objdir}/${subdir}"
index 0be8f170d19fda33cf3f5744d610b0196bdf854d..12933d898ed6e7dfdb507537f1807562b5c3844b 100644 (file)
@@ -23,8 +23,8 @@
 standard_testfile .c
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-     untested "failed to compile"
-     return -1
+    untested "failed to compile"
+    return
 }
 
 proc test_integer_literals_accepted {} {
index e0c5e669c2f202d7715b1966ac6a5b41942736d7..9482b0aee8ed9e40fa5ff26b2d877151c3d27b10 100644 (file)
@@ -52,7 +52,7 @@ with_test_prefix "run" {
     clean_restart $testfile
 
     if {![runto_main]} {
-       return -1
+       return
     }
 
     do_test
index 58c2c78ee26ac1111006314b337f4936f300d44e..ef358bef88e2197e6ad59ce395b2b111a598116c 100644 (file)
@@ -43,11 +43,11 @@ set test "set disable-randomization off"
 gdb_test_multiple "${test}" "${test}" {
     -re "Disabling randomization .* unsupported .*$gdb_prompt $" {
        untested "disabling randomization is not supported on this Linux GDB"
-       return -1
+       return
     }
     -re "No symbol .* in current context.*$gdb_prompt $" {
        untested "disabling randomization is not supported on this GDB platform"
-       return -1
+       return
     }
     -re "$gdb_prompt $" {
        pass $test
index bee3fbba4e78b5cbedb18618011b133a7793ac75..3857d90436f15961fa1d96a5cf3191a87d252d16 100644 (file)
@@ -98,7 +98,7 @@ gdb_test_multiple "" $test {
     }
     -re "$gdb_prompt " {
        fail $test
-       return 0
+       return
     }
 }
 
index f8f9adecf8f7bd97d555b11361f639127293a90c..c9e5830a3220a037af88f9685b32fac9f8bcc663 100644 (file)
@@ -154,7 +154,7 @@ save_vars { env(TERM) } {
 
     if { ![readline_is_used] } {
        unsupported "readline isn't used."
-       return -1
+       return
     }
 
     save_vars { timeout env(GDBHISTSIZE) env(GDBHISTFILE) } {
index 9f74b8b005d57da38d354090f50f7b0b98086d8c..bba1186a3441f2f46d948e85da8fe0fc0e21aadf 100644 (file)
@@ -27,7 +27,7 @@ if { [build_executable "failed to build" $testfile $srcfile { debug }] == -1 } {
 save_vars { GDBFLAGS } {
     append GDBFLAGS " --readnever"
     if { [clean_restart $testfile] == -1 } {
-       return -1
+       return
     }
 }
 
index 8c1ffc52e5091589eb7d36e46ca0223de05f691c..5b5d7cffd726047a8b8719264c99029d5bad2947 100644 (file)
@@ -21,8 +21,8 @@ append binfile .o
 
 remote_exec build "rm -f ${binfile}"
 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {debug}] != "" } {
-     untested "failed to compile"
-     return -1
+    untested "failed to compile"
+    return
 }
 
 clean_restart
index d5373ce3348bd30f30fc6d65229fd28134842194..15d1186a40a1b51397efc9211969f34aac361bf1 100644 (file)
@@ -27,7 +27,7 @@ foreach_with_prefix opts { "" "pie" } {
        if  { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile1}" \
                   executable ${testfile1_opt}] != "" } {
            untested "failed to compile first testcase"
-           return -1
+           return
        }
 
        # build the second test case
@@ -44,7 +44,7 @@ foreach_with_prefix opts { "" "pie" } {
              && [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${binfile2}" \
                      executable ${testfile2_opt2}] != ""} {
            untested "failed to compile second testcase"
-           return -1
+           return
        }
 
        # Start with a fresh gdb.
index e0aa63b8d5b0cedf8129615da553fb3d7f5e110a..7168aef49fce23ee49e8ad56b1981815b1b0d35d 100644 (file)
@@ -19,8 +19,8 @@
 standard_testfile .c
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-     untested "failed to compile"
-     return -1
+    untested "failed to compile"
+    return
 }
 
 set allow_float_test [allow_float_test]
index feac4e993ac1972ef5ec365d2a60e4eaa6d04a07..b8923492e4b806c6ee2171af875b9b33c116a438 100644 (file)
@@ -23,8 +23,8 @@
 standard_testfile .c
 
 if { [gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile} executable {debug}] != "" } {
-     untested "failed to compile"
-     return -1
+    untested "failed to compile"
+    return
 }
 
 proc_with_prefix test_setshow_annotate {} {
index cdf7af6b26f0e0a44662355b4a7ee4bff35586e2..f731eecbef77b05c843034fe77551e1bf3f15f75 100644 (file)
@@ -42,7 +42,7 @@ if { [prepare_for_testing "prepare" $testfile $srcfile $bin_flags] != 0 } {
 }
 
 if {![runto_main]} {
-  return 0
+    return
 }
 
 # Run until the program dies.
index 39694bffe6373b5bc5e31690c2745a6ca5b37672..eff7ffe16cbfbdb8c51f46b818b838c1dc73ae1c 100644 (file)
@@ -95,5 +95,5 @@ if { $load_segment_count <= 2 } {
 clean_restart $testfile
 
 if {![runto_main message]} {
-  return 0
+    return
 }
index cda9605b0db06b6c1ad5000c72137a43c04b15bb..83afcaba14945e84e3eeb3996857834eb0a942ef 100644 (file)
@@ -67,7 +67,7 @@ foreach libsepdebug {NO IN SEP} { with_test_prefix "$libsepdebug" {
     if { [gdb_compile_shlib ${srcfile_lib} ${binfile_lib} $sep_lib_flags] != ""
         || [gdb_compile ${srcfile} ${binfile} executable $bin_flags] != "" } {
       untested "failed to compile"
-      return -1
+      return
     }
 
     if {$libsepdebug == "SEP"} {
@@ -82,7 +82,7 @@ foreach libsepdebug {NO IN SEP} { with_test_prefix "$libsepdebug" {
     clean_restart $executable
 
     if {![runto_main]} {
-      return 0
+      return
     }
 
     gdb_test "display (int) a_global" "1: \\(int\\) a_global = 41"
index feb080708b70765539d8d90addee99113a17f408..3fc92d37e90bdc5c11bde389d8af3f6d1f9d4edb 100644 (file)
@@ -61,7 +61,7 @@ foreach prelink_lib1 {0x40000000 0x50000000} { with_test_prefix "$prelink_lib1"
         || [gdb_compile_shlib ${srcfile_lib} ${binfile_lib2} $lib_flags] != ""
         || [gdb_compile ${srcfile} ${binfile} executable $bin_flags] != "" } {
        untested "failed to compile"
-       return -1
+       return
     }
 
     if {[catch {exec prelink -N -r ${prelink_lib1} ${binfile_lib1}} output] != 0
@@ -69,7 +69,7 @@ foreach prelink_lib1 {0x40000000 0x50000000} { with_test_prefix "$prelink_lib1"
        # Maybe we don't have prelink.
        verbose -log "prelink failed: $output"
        untested "could not prelink ${binfile_lib1_test_msg} or ${binfile_lib2_test_msg}."
-       return -1
+       return
     }
 
     set test_spawn_id [spawn_wait_for_attach $binfile]
@@ -85,7 +85,7 @@ foreach prelink_lib1 {0x40000000 0x50000000} { with_test_prefix "$prelink_lib1"
         || [gdb_compile_shlib ${srcfile_lib} ${binfile_lib2} $lib_flags] != ""} {
        untested "failed to compile shared library"
        kill_wait_spawned_process $test_spawn_id
-       return -1
+       return
     }
 
     clean_restart ${binfile_base}
index 43f54b41df0e9df1c6253cded0168695b32f125a..3ae9bc442b2abef7fb2d5fefc743b76f37d373f6 100644 (file)
@@ -90,7 +90,7 @@ set corefile [standard_output_file solib-search.core]
 set core_supported [gdb_gcore_cmd "$corefile" "save a corefile"]
 
 if {!$core_supported} {
-  return -1
+    return
 }
 
 # Before we restart gdb, replace the libs with the "wrong" ones.
index efddd52eef9dd789e7bcfb24ea6d9c4d72cbdfb2..7a7941b9f4f4d3253ffdb3cffc9fd6c91cbcb450 100644 (file)
@@ -47,7 +47,7 @@ gdb_test "br foo2" \
 delete_breakpoints
 
 if {![runto_main]} {
-  return 0
+    return
 }
 
 # Break in the library.
index cb7c0997203283960965baa504b64b37308354f2..ea3db89d2e92435e44abd40e4224b123e0dbf675 100644 (file)
@@ -36,7 +36,7 @@ gdb_test_multiple "next" $test {
     -re "( test-fail .*|\r\nCannot insert breakpoint 0\\.\r\n.*)\r\n$gdb_prompt $" {
        xfail $test
        untested "system lacks support for tracking longjmps"
-       return -1
+       return
     }
 }
 gdb_test_no_output {delete $test_fail_bpnum}
index a580d7f201b30889e4cd7b353ee4f012e83d9355..e5fe59933bd14e90d5dee94eb57cabe1e604fff5 100644 (file)
 standard_testfile
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
-     return -1
+    return
 }
 
 if {![runto_main]} {
-   return 0
+    return
 }
 
 set bp_location [gdb_get_line_number "set breakpoint here"]
index e0a7583573843933eee8638d3a5221916fd8e7da..b85ea7800c483e7ce8b6ba74733a9e0855a1620f 100644 (file)
@@ -28,7 +28,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
 }
 
 if {![runto_main]} {
-   return 0
+    return
 }
 
 set remote_linefile [gdb_remote_download host ${srcdir}/${subdir}/${linefile}]
index b10a732f93bc2c9e5c797d1ea429e1686e949769..ccd636ab71d0da8087a62878fc88a84cb43138f5 100644 (file)
@@ -25,7 +25,7 @@ if { [prepare_for_testing "prepare" $testfile $srcfile] != 0 } {
 }
 
 if {![runto_main]} {
-   return 0
+    return
 }
 
 # Set a breakpoint at line 45, if stepi then finish fails, we would
@@ -142,10 +142,10 @@ gdb_test_multiple "finish" "$test" {
     -re ".*(Program received|$inferior_exited_re).*$gdb_prompt $" {
        # Oops... We ran to the end of the program...  Better reset
        if {![runto_main]} {
-           return 0
+           return
        }
        if {![runto step-test.c:45]} {
-           return 0
+           return
        }
        fail "$test"
     }
index 8895e88d4b5977486795e9524db278568360d9ad..7f56b2d49f2a332b7c1c8942508ef19553dfa657 100644 (file)
@@ -24,7 +24,7 @@ standard_testfile style.c
 
 with_ansi_styling_terminal {
     if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
-       return -1
+       return
     }
 
     if {![runto_main]} {
index 83de52c510b0131c47aee9df85ef3f26e451d55a..62887ebe71703d761788f1a786441cad4e43bbb4 100644 (file)
@@ -28,7 +28,7 @@ standard_testfile .c
 # and start with a fresh gdb
 
 if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
-     return -1
+    return
 }
 
 # Test that the inferior sees EXPECTED env vars starting with
index b6d3549072254154837eff716139a1b12ffdd818..219e3f900ac5e04b0e4beccbda1dbeb743a7261e 100644 (file)
@@ -26,7 +26,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
 }
 
 if {![runto "parent_stop"]} {
-  return -1
+    return
 }
 
 # We don't want to be bothered.
index 36614427cf9b2f4e90a24d49b9aeadc40bbf0521..2fd29e72508d2778a88a53024372cf2f331d4d64 100644 (file)
@@ -42,13 +42,13 @@ gdb_test_multiple "continue" $test {
        fail "$test (remote connection closed)"
        # Only if valgrind got stuck.
        kill_wait_spawned_process $valgrind_spawn_id
-       return -1
+       return
     }
     -re "The program is not being run\\.\r\n$gdb_prompt $" {
        fail "$test (valgrind vgdb has terminated)"
        # Only if valgrind got stuck.
        kill_wait_spawned_process $valgrind_spawn_id
-       return -1
+       return
     }
     -re "\r\n$gdb_prompt $" {
        pass "$test (false warning)"
index c39d318198373323f2899cdda48ce24334fa179d..ca13f42f076b86cbfe0dbb13556eff7dcb7fa7ec 100644 (file)
@@ -42,13 +42,13 @@ while {$loop && $continue_count < 100} {
            fail "$test (remote connection closed)"
            # Only if valgrind got stuck.
            kill_wait_spawned_process $valgrind_spawn_id
-           return -1
+           return
        }
        -re "The program is not being run\\.\r\n$gdb_prompt $" {
            fail "$test (valgrind vgdb has terminated)"
            # Only if valgrind got stuck.
            kill_wait_spawned_process $valgrind_spawn_id
-           return -1
+           return
        }
        -re "\r\n$gdb_prompt $" {
            pass "$test (false warning)"
index 4f61554dc68ad6563859cd4de52af819ccd45446..358a1dd42d8da1e58d54ca12426d901be31bbb04 100644 (file)
@@ -73,7 +73,7 @@ with_test_prefix "core" {
     set corefile [standard_output_file $testfile.core]
     set core_supported [gdb_gcore_cmd "$corefile" "save a corefile"]
     if {!$core_supported} {
-       return -1
+       return
     }
 
     clean_restart ${testfile}
index 29b9c3fd07dd3929b5bcf588d75386c7cbbc5e82..46eec592402d133cc27d34717d5c64eda610821f 100644 (file)
@@ -26,8 +26,8 @@ set allow_hw_watchpoint_tests_p [allow_hw_watchpoint_tests]
 standard_testfile
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-     untested "failed to compile"
-     return -1
+    untested "failed to compile"
+    return
 }
 
 # True if we're forcing no hardware watchpoints.
index d3cfd09d5de4a9db6c027500e79c36c9a5b215c7..d4c1a5fd87c61724ccbd5d9fc4725a6912f81262 100644 (file)
@@ -21,7 +21,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
 
 set bp_location [gdb_get_line_number "START"]
 if {![runto "wchar.c:$bp_location"]} {
-  return -1
+    return
 }
 
 gdb_test "print narrow" "= 97 L'a'"
index 98680e5c5a32c161afee677a6fa7f494b7949474..8a381843cffb3e01a5c089135ba11cba92973922 100644 (file)
@@ -28,8 +28,8 @@ set opaque_objfile [standard_output_file "$opaque_testfile.o"]
 if {[gdb_compile "${srcdir}/${subdir}/$opaque_testfile.c" \
                 $opaque_objfile \
                 object {}] != ""} {
-  untested "failed to compile"
-  return -1
+    untested "failed to compile"
+    return
 }
 
 if {[gdb_compile \