Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
To: gdb-patches@sourceware.org
Subject: [PATCH 26/36] GDB: testsuite: MI: Don't return -1 from top-level (manual)
Date: Mon, 27 Apr 2026 03:34:50 -0300	[thread overview]
Message-ID: <20260427063500.3847618-27-thiago.bauermann@linaro.org> (raw)
In-Reply-To: <20260427063500.3847618-1-thiago.bauermann@linaro.org>

This patch manually changes most "return -1" 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 block such as with_test_prefix,
  foreach_with_prefix, gdb_expect.
- procedure whose callers don't use the return value;

In one casae the whole if block was in a single line:

  if { condition } { return -1 }

I changed the formatting to the multi-line style we tend to use.
---
 gdb/testsuite/gdb.mi/gdb2549.exp                   |  4 ++--
 gdb/testsuite/gdb.mi/gdb701.exp                    |  4 ++--
 gdb/testsuite/gdb.mi/gdb792.exp                    |  4 ++--
 gdb/testsuite/gdb.mi/mi-async-run.exp              |  4 ++--
 gdb/testsuite/gdb.mi/mi-async.exp                  |  6 +++---
 gdb/testsuite/gdb.mi/mi-basics.exp                 |  4 ++--
 gdb/testsuite/gdb.mi/mi-break-qualified.exp        |  4 ++--
 gdb/testsuite/gdb.mi/mi-break.exp                  |  4 ++--
 gdb/testsuite/gdb.mi/mi-cli.exp                    |  4 ++--
 gdb/testsuite/gdb.mi/mi-cmd-param-changed.exp      |  4 ++--
 gdb/testsuite/gdb.mi/mi-complete.exp               |  4 ++--
 .../gdb.mi/mi-condbreak-call-thr-state.exp         |  2 +-
 gdb/testsuite/gdb.mi/mi-console.exp                |  4 ++--
 gdb/testsuite/gdb.mi/mi-corefile.exp               |  2 +-
 gdb/testsuite/gdb.mi/mi-detach.exp                 |  4 ++--
 gdb/testsuite/gdb.mi/mi-disassemble.exp            |  4 ++--
 gdb/testsuite/gdb.mi/mi-eval.exp                   |  4 ++--
 gdb/testsuite/gdb.mi/mi-exec-run.exp               |  4 ++--
 gdb/testsuite/gdb.mi/mi-file.exp                   |  4 ++--
 gdb/testsuite/gdb.mi/mi-fill-memory.exp            |  4 ++--
 gdb/testsuite/gdb.mi/mi-frame-regs.exp             |  8 +++++---
 .../gdb.mi/mi-inheritance-syntax-error.exp         |  4 ++--
 gdb/testsuite/gdb.mi/mi-pending.exp                |  4 ++--
 gdb/testsuite/gdb.mi/mi-read-memory.exp            |  4 ++--
 gdb/testsuite/gdb.mi/mi-reg-undefined.exp          |  4 ++--
 gdb/testsuite/gdb.mi/mi-regs.exp                   |  4 ++--
 gdb/testsuite/gdb.mi/mi-return.exp                 |  4 ++--
 gdb/testsuite/gdb.mi/mi-reverse.exp                |  6 +++---
 gdb/testsuite/gdb.mi/mi-simplerun.exp              |  4 ++--
 gdb/testsuite/gdb.mi/mi-solib.exp                  |  4 ++--
 gdb/testsuite/gdb.mi/mi-stack.exp                  |  4 ++--
 gdb/testsuite/gdb.mi/mi-start.exp                  |  4 ++--
 gdb/testsuite/gdb.mi/mi-stepi.exp                  |  4 ++--
 gdb/testsuite/gdb.mi/mi-syn-frame.exp              |  4 ++--
 gdb/testsuite/gdb.mi/mi-until.exp                  |  4 ++--
 gdb/testsuite/gdb.mi/mi-var-cmd.exp                |  2 +-
 gdb/testsuite/gdb.mi/mi-var-cp.exp                 |  6 +++---
 gdb/testsuite/gdb.mi/mi-var-rtti.exp               |  2 +-
 gdb/testsuite/gdb.mi/mi-vla-c99.exp                |  4 ++--
 gdb/testsuite/gdb.mi/mi-vla-fortran.exp            |  4 ++--
 gdb/testsuite/gdb.mi/mi-watch.exp                  |  4 ++--
 gdb/testsuite/gdb.mi/mi2-amd64-entry-value.exp     | 14 +++++++-------
 .../gdb.mi/user-selected-context-sync.exp          |  2 +-
 43 files changed, 92 insertions(+), 90 deletions(-)

diff --git a/gdb/testsuite/gdb.mi/gdb2549.exp b/gdb/testsuite/gdb.mi/gdb2549.exp
index c644e3bd1d32..570e1bdeb4a9 100644
--- a/gdb/testsuite/gdb.mi/gdb2549.exp
+++ b/gdb/testsuite/gdb.mi/gdb2549.exp
@@ -28,8 +28,8 @@ set MIFLAGS "-i=mi"
 standard_testfile basics.c
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-     untested "failed to compile"
-     return -1
+    untested "failed to compile"
+    return
 }
 
 proc register_tests_no_exec { } {
diff --git a/gdb/testsuite/gdb.mi/gdb701.exp b/gdb/testsuite/gdb.mi/gdb701.exp
index d72bd1ae81bf..dd6fd6181b2c 100644
--- a/gdb/testsuite/gdb.mi/gdb701.exp
+++ b/gdb/testsuite/gdb.mi/gdb701.exp
@@ -23,8 +23,8 @@ set MIFLAGS "-i=mi"
 standard_testfile
 
 if {[gdb_compile $srcdir/$subdir/$srcfile $binfile executable debug] != ""} {
-  untested "failed to compile"
-  return -1
+    untested "failed to compile"
+    return
 }
 
 # When varobj reports the types of objects, it often isn't really reporting
diff --git a/gdb/testsuite/gdb.mi/gdb792.exp b/gdb/testsuite/gdb.mi/gdb792.exp
index e2df8216956a..d0b7a97f02de 100644
--- a/gdb/testsuite/gdb.mi/gdb792.exp
+++ b/gdb/testsuite/gdb.mi/gdb792.exp
@@ -24,8 +24,8 @@ set MIFLAGS "-i=mi"
 standard_testfile .cc
 
 if {[gdb_compile $srcdir/$subdir/$srcfile $binfile executable {debug c++}] != ""} {
-  untested "failed to compile"
-  return -1
+    untested "failed to compile"
+    return
 }
 
 mi_clean_restart $::testfile
diff --git a/gdb/testsuite/gdb.mi/mi-async-run.exp b/gdb/testsuite/gdb.mi/mi-async-run.exp
index 5a4077b6d198..a60a85393225 100644
--- a/gdb/testsuite/gdb.mi/mi-async-run.exp
+++ b/gdb/testsuite/gdb.mi/mi-async-run.exp
@@ -18,8 +18,8 @@ load_lib mi-support.exp
 standard_testfile
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-     untested "failed to compile"
-     return -1
+    untested "failed to compile"
+    return
 }
 
 # Test the resolution of PR 18077
diff --git a/gdb/testsuite/gdb.mi/mi-async.exp b/gdb/testsuite/gdb.mi/mi-async.exp
index d1674cdfe49f..7f7603cf7068 100644
--- a/gdb/testsuite/gdb.mi/mi-async.exp
+++ b/gdb/testsuite/gdb.mi/mi-async.exp
@@ -23,7 +23,7 @@
 # we're actually testing native.
 require isnative
 if {![istarget *-linux*]} {
-  return
+    return
 }
 
 # Check if start command is supported.
@@ -34,8 +34,8 @@ load_lib mi-support.exp
 standard_testfile basics.c
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-     untested "failed to compile"
-     return -1
+    untested "failed to compile"
+    return
 }
 
 # The plan is for async mode to become the default but toggle for now.
diff --git a/gdb/testsuite/gdb.mi/mi-basics.exp b/gdb/testsuite/gdb.mi/mi-basics.exp
index 27ac334e4a30..8f18f41af04b 100644
--- a/gdb/testsuite/gdb.mi/mi-basics.exp
+++ b/gdb/testsuite/gdb.mi/mi-basics.exp
@@ -37,8 +37,8 @@ set testsubdir [standard_output_file ""]
 set envirodir [string_to_regexp $testsubdir]
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-     untested "failed to compile"
-     return -1
+    untested "failed to compile"
+    return
 }
 
 # In this file we want to test if the operations needed by the following
diff --git a/gdb/testsuite/gdb.mi/mi-break-qualified.exp b/gdb/testsuite/gdb.mi/mi-break-qualified.exp
index 1bb8258b9536..d196c37ef78b 100644
--- a/gdb/testsuite/gdb.mi/mi-break-qualified.exp
+++ b/gdb/testsuite/gdb.mi/mi-break-qualified.exp
@@ -24,8 +24,8 @@ set MIFLAGS "-i=mi"
 standard_testfile .cc
 
 if {[build_executable $testfile.exp $testfile $srcfile {c++ debug}] == -1} {
-     untested "failed to compile"
-     return -1
+    untested "failed to compile"
+    return
 }
 
 set loc_ns_func_line [gdb_get_line_number "location NS::func here"]
diff --git a/gdb/testsuite/gdb.mi/mi-break.exp b/gdb/testsuite/gdb.mi/mi-break.exp
index a7b64faa8a5a..b0df2cedc4e5 100644
--- a/gdb/testsuite/gdb.mi/mi-break.exp
+++ b/gdb/testsuite/gdb.mi/mi-break.exp
@@ -26,8 +26,8 @@ set MIFLAGS "-i=mi"
 standard_testfile basics.c
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-     untested "failed to compile"
-     return -1
+    untested "failed to compile"
+    return
 }
 
 # Locate line numbers in basics.c.
diff --git a/gdb/testsuite/gdb.mi/mi-cli.exp b/gdb/testsuite/gdb.mi/mi-cli.exp
index e3a5d3b87a25..9d696e4b291c 100644
--- a/gdb/testsuite/gdb.mi/mi-cli.exp
+++ b/gdb/testsuite/gdb.mi/mi-cli.exp
@@ -25,8 +25,8 @@ set MIFLAGS "-i=mi"
 standard_testfile basics.c
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-     untested "failed to compile"
-     return -1
+    untested "failed to compile"
+    return
 }
 
 mi_clean_restart $::testfile
diff --git a/gdb/testsuite/gdb.mi/mi-cmd-param-changed.exp b/gdb/testsuite/gdb.mi/mi-cmd-param-changed.exp
index 29c44c8475c3..9d43fc6e21c0 100644
--- a/gdb/testsuite/gdb.mi/mi-cmd-param-changed.exp
+++ b/gdb/testsuite/gdb.mi/mi-cmd-param-changed.exp
@@ -22,8 +22,8 @@ set MIFLAGS "-i=mi"
 standard_testfile basics.c
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-     untested "failed to compile"
-     return -1
+    untested "failed to compile"
+    return
 }
 
 proc test_command_param_changed { } {
diff --git a/gdb/testsuite/gdb.mi/mi-complete.exp b/gdb/testsuite/gdb.mi/mi-complete.exp
index 4038ae57f8ac..54084cab86d3 100644
--- a/gdb/testsuite/gdb.mi/mi-complete.exp
+++ b/gdb/testsuite/gdb.mi/mi-complete.exp
@@ -22,8 +22,8 @@ set MIFLAGS "-i=mi"
 standard_testfile .cc
 
 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
-     untested "failed to compile"
-     return -1
+    untested "failed to compile"
+    return
 }
 
 mi_clean_restart $::testfile
diff --git a/gdb/testsuite/gdb.mi/mi-condbreak-call-thr-state.exp b/gdb/testsuite/gdb.mi/mi-condbreak-call-thr-state.exp
index 34ac495bb5d6..bda6753d65e0 100644
--- a/gdb/testsuite/gdb.mi/mi-condbreak-call-thr-state.exp
+++ b/gdb/testsuite/gdb.mi/mi-condbreak-call-thr-state.exp
@@ -56,7 +56,7 @@ proc test { variant } {
 		 $testfile \
 		 "${srcfile} ${srcfile2}" \
 		 $options] == -1} {
-	    return -1
+	    return
 	}
 
 	if {[mi_clean_restart $::testfile]} {
diff --git a/gdb/testsuite/gdb.mi/mi-console.exp b/gdb/testsuite/gdb.mi/mi-console.exp
index a7a083a56766..23ae1a280997 100644
--- a/gdb/testsuite/gdb.mi/mi-console.exp
+++ b/gdb/testsuite/gdb.mi/mi-console.exp
@@ -49,8 +49,8 @@ proc semihosted_string { string } {
 standard_testfile
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-     untested "failed to compile"
-     return -1
+    untested "failed to compile"
+    return
 }
 
 if {[mi_clean_restart $::testfile]} {
diff --git a/gdb/testsuite/gdb.mi/mi-corefile.exp b/gdb/testsuite/gdb.mi/mi-corefile.exp
index 67c6183f3867..864c8f74ddcf 100644
--- a/gdb/testsuite/gdb.mi/mi-corefile.exp
+++ b/gdb/testsuite/gdb.mi/mi-corefile.exp
@@ -30,7 +30,7 @@ if {[build_executable $testfile.exp $testfile $srcfile debug] == -1} {
 set corefile [core_find $binfile {}]
 if {$corefile == ""} {
     untested "unable to create or find corefile"
-    return 0
+    return
 }
 
 if {[mi_gdb_start]} {
diff --git a/gdb/testsuite/gdb.mi/mi-detach.exp b/gdb/testsuite/gdb.mi/mi-detach.exp
index 62bd699ea8ac..e82e216315e7 100644
--- a/gdb/testsuite/gdb.mi/mi-detach.exp
+++ b/gdb/testsuite/gdb.mi/mi-detach.exp
@@ -21,8 +21,8 @@ set MIFLAGS "-i=mi"
 standard_testfile basics.c
 
 if {[build_executable $testfile.exp $testfile $srcfile {debug}] == -1} {
-     untested "failed to compile"
-     return -1
+    untested "failed to compile"
+    return
 }
 
 mi_clean_restart $::testfile
diff --git a/gdb/testsuite/gdb.mi/mi-disassemble.exp b/gdb/testsuite/gdb.mi/mi-disassemble.exp
index cd4c91bd06a6..2ecbce193c75 100644
--- a/gdb/testsuite/gdb.mi/mi-disassemble.exp
+++ b/gdb/testsuite/gdb.mi/mi-disassemble.exp
@@ -26,8 +26,8 @@ set MIFLAGS "-i=mi"
 standard_testfile basics.c
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-     untested "failed to compile"
-     return -1
+    untested "failed to compile"
+    return
 }
 
 proc test_disassembly_only {} {
diff --git a/gdb/testsuite/gdb.mi/mi-eval.exp b/gdb/testsuite/gdb.mi/mi-eval.exp
index 6720f878538a..f2761f46219b 100644
--- a/gdb/testsuite/gdb.mi/mi-eval.exp
+++ b/gdb/testsuite/gdb.mi/mi-eval.exp
@@ -28,8 +28,8 @@ set MIFLAGS "-i=mi"
 standard_testfile basics.c
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-     untested "failed to compile"
-     return -1
+    untested "failed to compile"
+    return
 }
 
 if {[mi_clean_restart $::testfile]} {
diff --git a/gdb/testsuite/gdb.mi/mi-exec-run.exp b/gdb/testsuite/gdb.mi/mi-exec-run.exp
index 9707504aa21c..d7a680daa6c6 100644
--- a/gdb/testsuite/gdb.mi/mi-exec-run.exp
+++ b/gdb/testsuite/gdb.mi/mi-exec-run.exp
@@ -35,8 +35,8 @@ set have_startup_shell [have_startup_shell]
 standard_testfile mi-start.c
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-     untested "could not build mi-exec-run"
-     return -1
+    untested "could not build mi-exec-run"
+    return
 }
 
 # The test proper.  INFTTY_MODE determines whether "set inferior-tty"
diff --git a/gdb/testsuite/gdb.mi/mi-file.exp b/gdb/testsuite/gdb.mi/mi-file.exp
index 8ca0511f55d8..80411b82ff74 100644
--- a/gdb/testsuite/gdb.mi/mi-file.exp
+++ b/gdb/testsuite/gdb.mi/mi-file.exp
@@ -21,8 +21,8 @@ set MIFLAGS "-i=mi"
 standard_testfile basics.c
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-     untested "failed to compile"
-     return -1
+    untested "failed to compile"
+    return
 }
 
 if {[mi_clean_restart]} {
diff --git a/gdb/testsuite/gdb.mi/mi-fill-memory.exp b/gdb/testsuite/gdb.mi/mi-fill-memory.exp
index 524732bebbd6..f9bd13209822 100644
--- a/gdb/testsuite/gdb.mi/mi-fill-memory.exp
+++ b/gdb/testsuite/gdb.mi/mi-fill-memory.exp
@@ -23,8 +23,8 @@ set MIFLAGS "-i=mi"
 standard_testfile "mi-read-memory"
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}.c" "${binfile}" executable {debug}] != "" } {
-     untested "failed to compile"
-     return -1
+    untested "failed to compile"
+    return
 }
 
 mi_clean_restart $::testfile
diff --git a/gdb/testsuite/gdb.mi/mi-frame-regs.exp b/gdb/testsuite/gdb.mi/mi-frame-regs.exp
index 65e3bd93d4a4..5d408f4d23e6 100644
--- a/gdb/testsuite/gdb.mi/mi-frame-regs.exp
+++ b/gdb/testsuite/gdb.mi/mi-frame-regs.exp
@@ -26,8 +26,8 @@ standard_testfile basics.c
 
 if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
 		 executable {debug}] != "" } then {
-     untested "failed to compile"
-     return -1
+    untested "failed to compile"
+    return
 }
 
 # Return the address of the specified breakpoint.
@@ -98,7 +98,9 @@ proc_with_prefix do_floating_varobj_test {} {
 
 	# Get the address of the current breakpoint.
 	set bpaddr [breakpoint_address $bpnum]
-	if {$bpaddr == ""} { return }
+	if {$bpaddr == ""} {
+	    return
+	}
 
 	# Check that the addresses are the same.
 	gdb_assert [expr {$bpaddr == $pcval}] "\$pc equals address of breakpoint in callee$i"
diff --git a/gdb/testsuite/gdb.mi/mi-inheritance-syntax-error.exp b/gdb/testsuite/gdb.mi/mi-inheritance-syntax-error.exp
index d9baa7639525..17ed3f1dcefd 100644
--- a/gdb/testsuite/gdb.mi/mi-inheritance-syntax-error.exp
+++ b/gdb/testsuite/gdb.mi/mi-inheritance-syntax-error.exp
@@ -21,8 +21,8 @@ set MIFLAGS "-i=mi"
 standard_testfile .cc
 
 if {[gdb_compile $srcdir/$subdir/$srcfile $binfile executable {debug c++}] != ""} {
-  untested "failed to compile"
-  return -1
+    untested "failed to compile"
+    return
 }
 
 if {[mi_clean_restart $::testfile]} {
diff --git a/gdb/testsuite/gdb.mi/mi-pending.exp b/gdb/testsuite/gdb.mi/mi-pending.exp
index 1ad9aecdc8b4..51be357d4c0a 100644
--- a/gdb/testsuite/gdb.mi/mi-pending.exp
+++ b/gdb/testsuite/gdb.mi/mi-pending.exp
@@ -141,10 +141,10 @@ set testname "run till MI pending breakpoint on pendfunc3 on thread 2"
 gdb_expect {
     -re "\\*stopped,reason=\"breakpoint-hit\",disp=\"keep\",bkptno=\"4\",frame=\{addr=\"$hex\",func=\"pendfunc3\".*thread-id=\"2\".*" {
 	pass $testname
-	return 0
+	return
     }
     timeout {
 	fail "$testname (timeout)"
-	return -1
+	return
     }
 }
diff --git a/gdb/testsuite/gdb.mi/mi-read-memory.exp b/gdb/testsuite/gdb.mi/mi-read-memory.exp
index 782c0ee13dca..035c31e2ae84 100644
--- a/gdb/testsuite/gdb.mi/mi-read-memory.exp
+++ b/gdb/testsuite/gdb.mi/mi-read-memory.exp
@@ -21,8 +21,8 @@ set MIFLAGS "-i=mi"
 standard_testfile
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-     untested "failed to compile"
-     return -1
+    untested "failed to compile"
+    return
 }
 
 mi_clean_restart $::testfile
diff --git a/gdb/testsuite/gdb.mi/mi-reg-undefined.exp b/gdb/testsuite/gdb.mi/mi-reg-undefined.exp
index dd7b2961b03f..725925d01a81 100644
--- a/gdb/testsuite/gdb.mi/mi-reg-undefined.exp
+++ b/gdb/testsuite/gdb.mi/mi-reg-undefined.exp
@@ -25,8 +25,8 @@ require is_x86_64_m64_target
 standard_testfile .S
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nopie}] != "" } {
-     untested "failed to compile"
-     return -1
+    untested "failed to compile"
+    return
 }
 
 if {[mi_clean_restart $::testfile]} {
diff --git a/gdb/testsuite/gdb.mi/mi-regs.exp b/gdb/testsuite/gdb.mi/mi-regs.exp
index 7aa4fb62c7ac..756855d9ded0 100644
--- a/gdb/testsuite/gdb.mi/mi-regs.exp
+++ b/gdb/testsuite/gdb.mi/mi-regs.exp
@@ -28,8 +28,8 @@ set MIFLAGS "-i=mi"
 standard_testfile basics.c
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-     untested "failed to compile"
-     return -1
+    untested "failed to compile"
+    return
 }
 
 proc sparc_register_tests_no_exec { } {
diff --git a/gdb/testsuite/gdb.mi/mi-return.exp b/gdb/testsuite/gdb.mi/mi-return.exp
index bd90ac79893f..c9265c80317a 100644
--- a/gdb/testsuite/gdb.mi/mi-return.exp
+++ b/gdb/testsuite/gdb.mi/mi-return.exp
@@ -27,8 +27,8 @@ set MIFLAGS "-i=mi"
 standard_testfile basics.c
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-     untested "failed to compile"
-     return -1
+    untested "failed to compile"
+    return
 }
 
 if {[mi_clean_restart $::testfile]} {
diff --git a/gdb/testsuite/gdb.mi/mi-reverse.exp b/gdb/testsuite/gdb.mi/mi-reverse.exp
index 100857c6e299..dacb86048f60 100644
--- a/gdb/testsuite/gdb.mi/mi-reverse.exp
+++ b/gdb/testsuite/gdb.mi/mi-reverse.exp
@@ -35,8 +35,8 @@ set MIFLAGS "-i=mi"
 standard_testfile basics.c
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-     untested "failed to compile"
-     return -1
+    untested "failed to compile"
+    return
 }
 
 mi_clean_restart $::testfile
@@ -48,7 +48,7 @@ if {[supports_process_record]} {
 	     "=record-started,thread-group=\"i1\",method=\"full\"\r\n\\^done" \
 	     "Turn on process record"]} {
 	warning "Fail to activate process record/replay, tests in this group will not be performed.\n"
-	return -1
+	return
     }
 }
 
diff --git a/gdb/testsuite/gdb.mi/mi-simplerun.exp b/gdb/testsuite/gdb.mi/mi-simplerun.exp
index 8f18a63e46cc..98bc3da89191 100644
--- a/gdb/testsuite/gdb.mi/mi-simplerun.exp
+++ b/gdb/testsuite/gdb.mi/mi-simplerun.exp
@@ -30,8 +30,8 @@ set MIFLAGS "-i=mi"
 standard_testfile basics.c
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-     untested "failed to compile"
-     return -1
+    untested "failed to compile"
+    return
 }
 
 if {[mi_clean_restart $::testfile]} {
diff --git a/gdb/testsuite/gdb.mi/mi-solib.exp b/gdb/testsuite/gdb.mi/mi-solib.exp
index 0a13df407a09..a3c4d20b0004 100644
--- a/gdb/testsuite/gdb.mi/mi-solib.exp
+++ b/gdb/testsuite/gdb.mi/mi-solib.exp
@@ -30,8 +30,8 @@ set bin_flags [list debug shlib=${binfile_lib}]
 
 if { [gdb_compile_shlib ${srcfile_lib} ${binfile_lib} $lib_flags] != ""
      || [gdb_compile ${srcfile_main} ${binfile} executable $bin_flags] != "" } {
-  untested "failed to compile"
-  return -1
+    untested "failed to compile"
+    return
 }
 
 if {[mi_clean_restart $::testfile]} {
diff --git a/gdb/testsuite/gdb.mi/mi-stack.exp b/gdb/testsuite/gdb.mi/mi-stack.exp
index 2b7884076da1..fbfc0619d008 100644
--- a/gdb/testsuite/gdb.mi/mi-stack.exp
+++ b/gdb/testsuite/gdb.mi/mi-stack.exp
@@ -28,8 +28,8 @@ set MIFLAGS "-i=mi"
 standard_testfile
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-     untested "failed to compile"
-     return -1
+    untested "failed to compile"
+    return
 }
 
 if {[mi_clean_restart $::testfile]} {
diff --git a/gdb/testsuite/gdb.mi/mi-start.exp b/gdb/testsuite/gdb.mi/mi-start.exp
index 5a232f0e6cd4..ff18866987f0 100644
--- a/gdb/testsuite/gdb.mi/mi-start.exp
+++ b/gdb/testsuite/gdb.mi/mi-start.exp
@@ -24,8 +24,8 @@ require !use_gdb_stub
 standard_testfile mi-start.c
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-     untested "could not build mi-start"
-     return -1
+    untested "could not build mi-start"
+    return
 }
 
 if {[mi_clean_restart $::testfile]} {
diff --git a/gdb/testsuite/gdb.mi/mi-stepi.exp b/gdb/testsuite/gdb.mi/mi-stepi.exp
index fe8854a79050..8b9ca60ac434 100644
--- a/gdb/testsuite/gdb.mi/mi-stepi.exp
+++ b/gdb/testsuite/gdb.mi/mi-stepi.exp
@@ -26,8 +26,8 @@ set MIFLAGS "-i=mi"
 standard_testfile basics.c
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-     untested "failed to compile"
-     return -1
+    untested "failed to compile"
+    return
 }
 
 proc test_stepi_nexti {} {
diff --git a/gdb/testsuite/gdb.mi/mi-syn-frame.exp b/gdb/testsuite/gdb.mi/mi-syn-frame.exp
index 410849a910a5..f3b1a71ccb3c 100644
--- a/gdb/testsuite/gdb.mi/mi-syn-frame.exp
+++ b/gdb/testsuite/gdb.mi/mi-syn-frame.exp
@@ -25,8 +25,8 @@ set any "\[^\"\]+"
 standard_testfile
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-     untested "failed to compile"
-     return -1
+    untested "failed to compile"
+    return
 }
 
 mi_clean_restart $::testfile
diff --git a/gdb/testsuite/gdb.mi/mi-until.exp b/gdb/testsuite/gdb.mi/mi-until.exp
index a84a1238ae45..f508ce292e1f 100644
--- a/gdb/testsuite/gdb.mi/mi-until.exp
+++ b/gdb/testsuite/gdb.mi/mi-until.exp
@@ -27,8 +27,8 @@ set MIFLAGS "-i=mi"
 standard_testfile until.c
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-     untested "failed to compile"
-     return -1
+    untested "failed to compile"
+    return
 }
 
 if {[mi_clean_restart $::testfile]} {
diff --git a/gdb/testsuite/gdb.mi/mi-var-cmd.exp b/gdb/testsuite/gdb.mi/mi-var-cmd.exp
index bf207dad255e..a08528002cb1 100644
--- a/gdb/testsuite/gdb.mi/mi-var-cmd.exp
+++ b/gdb/testsuite/gdb.mi/mi-var-cmd.exp
@@ -592,7 +592,7 @@ lappend inline_tests floating
 
 foreach_with_prefix inline_test $inline_tests {
     if { [mi_run_inline_test $inline_test] < 0 } {
-	return -1
+	return
     }
 }
 
diff --git a/gdb/testsuite/gdb.mi/mi-var-cp.exp b/gdb/testsuite/gdb.mi/mi-var-cp.exp
index db9efd67fd3d..fb850ad51db5 100644
--- a/gdb/testsuite/gdb.mi/mi-var-cp.exp
+++ b/gdb/testsuite/gdb.mi/mi-var-cp.exp
@@ -21,8 +21,8 @@ set MIFLAGS "-i=mi"
 standard_testfile .cc
 
 if {[gdb_compile $srcdir/$subdir/$srcfile $binfile executable {debug c++}] != ""} {
-  untested "failed to compile"
-  return -1
+    untested "failed to compile"
+    return
 }
 
 if {[mi_clean_restart $::testfile]} {
@@ -41,7 +41,7 @@ set inline_tests {
 
 foreach_with_prefix inline_test $inline_tests {
     if { [mi_run_inline_test $inline_test] < 0 } {
-	return -1
+	return
     }
 }
 
diff --git a/gdb/testsuite/gdb.mi/mi-var-rtti.exp b/gdb/testsuite/gdb.mi/mi-var-rtti.exp
index 9a98e2adfa9c..4a1bee241f9f 100644
--- a/gdb/testsuite/gdb.mi/mi-var-rtti.exp
+++ b/gdb/testsuite/gdb.mi/mi-var-rtti.exp
@@ -118,7 +118,7 @@ set inline_tests {
 
 foreach_with_prefix inline_test $inline_tests {
     if { [mi_run_inline_test $inline_test] < 0 } {
-       return -1
+	return
     }
 }
 
diff --git a/gdb/testsuite/gdb.mi/mi-vla-c99.exp b/gdb/testsuite/gdb.mi/mi-vla-c99.exp
index 91934de2491d..5e3c8f549407 100644
--- a/gdb/testsuite/gdb.mi/mi-vla-c99.exp
+++ b/gdb/testsuite/gdb.mi/mi-vla-c99.exp
@@ -25,8 +25,8 @@ standard_testfile vla.c
 
 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" \
 		  "${binfile}" executable {debug}] != "" } {
-     untested "failed to compile"
-     return -1
+    untested "failed to compile"
+    return
 }
 
 if {[mi_clean_restart $::testfile]} {
diff --git a/gdb/testsuite/gdb.mi/mi-vla-fortran.exp b/gdb/testsuite/gdb.mi/mi-vla-fortran.exp
index fd144cb51e7a..0cc51a36f5ef 100644
--- a/gdb/testsuite/gdb.mi/mi-vla-fortran.exp
+++ b/gdb/testsuite/gdb.mi/mi-vla-fortran.exp
@@ -26,8 +26,8 @@ standard_testfile vla.f90
 
 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable \
      {debug f90}] != "" } {
-     untested "failed to compile"
-     return -1
+    untested "failed to compile"
+    return
 }
 
 # Depending on the compiler being used,
diff --git a/gdb/testsuite/gdb.mi/mi-watch.exp b/gdb/testsuite/gdb.mi/mi-watch.exp
index 4fcba501224c..5b01793aa3da 100644
--- a/gdb/testsuite/gdb.mi/mi-watch.exp
+++ b/gdb/testsuite/gdb.mi/mi-watch.exp
@@ -34,8 +34,8 @@ set MIFLAGS "-i=mi"
 standard_testfile basics.c
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-     untested "failed to compile"
-     return -1
+    untested "failed to compile"
+    return
 }
 
 proc test_watchpoint_creation_and_listing {} {
diff --git a/gdb/testsuite/gdb.mi/mi2-amd64-entry-value.exp b/gdb/testsuite/gdb.mi/mi2-amd64-entry-value.exp
index fcea890d78af..adcd713453c6 100644
--- a/gdb/testsuite/gdb.mi/mi2-amd64-entry-value.exp
+++ b/gdb/testsuite/gdb.mi/mi2-amd64-entry-value.exp
@@ -44,7 +44,7 @@ foreach name {different breakhere_different breakhere_validity breakhere_invalid
 
 with_test_prefix "entry-values=no" {
     if {[mi_runto_main] == -1} {
-	return -1
+	return
     }
     mi_gdb_test "-gdb-set print entry-values no" {\^done} "no: set print entry-values"
     mi_send_resuming_command "exec-continue" "no: entry_equal: continue"
@@ -63,7 +63,7 @@ with_test_prefix "entry-values=no" {
 
 with_test_prefix "entry-values=only" {
     if {[mi_runto_main] == -1} {
-	return -1
+	return
     }
     mi_gdb_test "-gdb-set print entry-values only" {\^done} "only: set print entry-values"
     mi_send_resuming_command "exec-continue" "only: entry_equal: continue"
@@ -82,7 +82,7 @@ with_test_prefix "entry-values=only" {
 
 with_test_prefix "entry-values=preferred" {
     if {[mi_runto_main] == -1} {
-	return -1
+	return
     }
     mi_gdb_test "-gdb-set print entry-values preferred" {\^done} "preferred: set print entry-values"
     mi_send_resuming_command "exec-continue" "preferred: entry_equal: continue"
@@ -101,7 +101,7 @@ with_test_prefix "entry-values=preferred" {
 
 with_test_prefix "entry-values=if-needed" {
     if {[mi_runto_main] == -1} {
-	return -1
+	return
     }
     mi_gdb_test "-gdb-set print entry-values if-needed" {\^done} "if-needed: set print entry-values"
     mi_send_resuming_command "exec-continue" "if-needed: entry_equal: continue"
@@ -120,7 +120,7 @@ with_test_prefix "entry-values=if-needed" {
 
 with_test_prefix "entry-values=both" {
     if {[mi_runto_main] == -1} {
-	return -1
+	return
     }
     mi_gdb_test "-gdb-set print entry-values both" {\^done} "both: set print entry-values"
     mi_send_resuming_command "exec-continue" "both: entry_equal: continue"
@@ -139,7 +139,7 @@ with_test_prefix "entry-values=both" {
 
 with_test_prefix "entry-values=compact" {
     if {[mi_runto_main] == -1} {
-	return -1
+	return
     }
     mi_gdb_test "-gdb-set print entry-values compact" {\^done} "compact: set print entry-values"
     mi_send_resuming_command "exec-continue" "compact: entry_equal: continue"
@@ -158,7 +158,7 @@ with_test_prefix "entry-values=compact" {
 
 with_test_prefix "entry-values=default" {
     if {[mi_runto_main] == -1} {
-	return -1
+	return
     }
     mi_gdb_test "-gdb-set print entry-values default" {\^done} "default: set print entry-values"
     mi_send_resuming_command "exec-continue" "default: entry_equal: continue"
diff --git a/gdb/testsuite/gdb.mi/user-selected-context-sync.exp b/gdb/testsuite/gdb.mi/user-selected-context-sync.exp
index fea284b70125..d94e9eb75f40 100644
--- a/gdb/testsuite/gdb.mi/user-selected-context-sync.exp
+++ b/gdb/testsuite/gdb.mi/user-selected-context-sync.exp
@@ -392,7 +392,7 @@ proc_with_prefix test_setup { mode } {
     set any "\[^\r\n\]*"
 
     if { [mi_runto_main] < 0 } {
-	return -1
+	return
     }
 
     # When using mi_expect_stop, we don't expect a prompt after the *stopped

  parent reply	other threads:[~2026-04-27  6:42 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-27  6:34 [PATCH 00/36] GDB: testsuite: Fix top-level returns Thiago Jung Bauermann
2026-04-27  6:34 ` [PATCH 01/36] GDB: testsuite: aarch64, arm: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-27  6:34 ` [PATCH 02/36] GDB: testsuite: aarch64, arm: Don't return -1 from top-level (manual) Thiago Jung Bauermann
2026-04-27  6:34 ` [PATCH 03/36] GDB: testsuite: intel: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-28 15:54   ` Schimpe, Christina
2026-04-28 16:42     ` Schimpe, Christina
2026-04-27  6:34 ` [PATCH 04/36] GDB: testsuite: intel: Don't return -1 from top-level (manual) Thiago Jung Bauermann
2026-04-28 16:39   ` Schimpe, Christina
2026-04-28 21:48     ` Thiago Jung Bauermann
2026-04-27  6:34 ` [PATCH 05/36] GDB: testsuite: powerpc: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-27  6:34 ` [PATCH 06/36] GDB: testsuite: powerpc: Don't return -1 from top-level (manual) Thiago Jung Bauermann
2026-04-27  6:34 ` [PATCH 07/36] GDB: testsuite: riscv: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-27  6:34 ` [PATCH 08/36] GDB: testsuite: riscv: Don't return -1 from top-level (manual) Thiago Jung Bauermann
2026-04-27  6:34 ` [PATCH 09/36] GDB: testsuite: s390: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-27  6:34 ` [PATCH 10/36] GDB: testsuite: sparc: " Thiago Jung Bauermann
2026-04-27  6:34 ` [PATCH 11/36] GDB: testsuite: Don't return -1 from top-level in tests of various arches Thiago Jung Bauermann
2026-04-27  6:34 ` [PATCH 12/36] GDB: testsuite: Don't return -1 from top-level in multi-arch tests Thiago Jung Bauermann
2026-04-27  6:34 ` [PATCH 13/36] GDB: testsuite: base: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-27  6:34 ` [PATCH 14/36] GDB: testsuite: base: Don't return 0 " Thiago Jung Bauermann
2026-04-27  6:34 ` [PATCH 15/36] GDB: testsuite: base: Don't return -1 from top-level (manual) Thiago Jung Bauermann
2026-04-27  6:34 ` [PATCH 16/36] GDB: testsuite: C++: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-27  6:34 ` [PATCH 17/36] GDB: testsuite: C++: Don't return -1 from top-level (manual) Thiago Jung Bauermann
2026-04-27  6:34 ` [PATCH 18/36] GDB: testsuite: DWARF: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-27  6:34 ` [PATCH 19/36] GDB: testsuite: DWARF: Don't return -1 from top-level (manual) Thiago Jung Bauermann
2026-04-27  6:34 ` [PATCH 20/36] GDB: testsuite: GDB: Don't return -1 from top-level Thiago Jung Bauermann
2026-04-27  6:34 ` [PATCH 21/36] GDB: testsuite: Guile: " Thiago Jung Bauermann
2026-04-27  6:34 ` [PATCH 22/36] GDB: testsuite: Python: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-27  6:34 ` [PATCH 23/36] GDB: testsuite: Python: Don't return -1 from top-level (manual) Thiago Jung Bauermann
2026-04-27  6:34 ` [PATCH 24/36] GDB: testsuite: linespec: Don't return -1 from top-level Thiago Jung Bauermann
2026-04-27  6:34 ` [PATCH 25/36] GDB: testsuite: MI: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-27  6:34 ` Thiago Jung Bauermann [this message]
2026-04-27  6:34 ` [PATCH 27/36] GDB: testsuite: reverse: " Thiago Jung Bauermann
2026-04-27  6:34 ` [PATCH 28/36] GDB: testsuite: reverse: Don't return -1 from top-level (manual) Thiago Jung Bauermann
2026-04-27  6:34 ` [PATCH 29/36] GDB: testsuite: server: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-27  6:34 ` [PATCH 30/36] GDB: testsuite: server: Don't return -1 from top-level (manual) Thiago Jung Bauermann
2026-04-27  6:34 ` [PATCH 31/36] GDB: testsuite: threads: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-27  6:34 ` [PATCH 32/36] GDB: testsuite: threads: Don't return 0 " Thiago Jung Bauermann
2026-04-27  6:34 ` [PATCH 33/36] GDB: testsuite: threads: Don't return -1 from top-level (manual) Thiago Jung Bauermann
2026-04-27  6:34 ` [PATCH 34/36] GDB: testsuite: TUI: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-27  6:34 ` [PATCH 35/36] GDB: testsuite: TUI: Don't return 0 from top-level (manual) Thiago Jung Bauermann
2026-04-27  6:35 ` [PATCH 36/36] GDB: testsuite: XML: Don't return -1 nor 0 from top-level Thiago Jung Bauermann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260427063500.3847618-27-thiago.bauermann@linaro.org \
    --to=thiago.bauermann@linaro.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox