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 v2 25/37] GDB: testsuite: linespec: Don't return value from top-level
Date: Wed, 29 Apr 2026 20:04:16 -0300	[thread overview]
Message-ID: <20260429230432.60487-26-thiago.bauermann@linaro.org> (raw)
In-Reply-To: <20260429230432.60487-1-thiago.bauermann@linaro.org>

Most changes are the result of running:

$ sed -i 's/^    return -1/    return/' *.exp

inside gdb/testsuite/gdb.linespec.  The exceptions fall into one of
these criteria:

- misaligned line, which is then fixed by this patch;
- return at top level but inside a namespace block.

A couple of "return 0" statements were also fixed.
---
 gdb/testsuite/gdb.linespec/break-ask.exp                  | 2 +-
 gdb/testsuite/gdb.linespec/break-asm-file.exp             | 8 ++++----
 gdb/testsuite/gdb.linespec/cp-completion-aliases.exp      | 2 +-
 .../gdb.linespec/cp-replace-typedefs-ns-template.exp      | 2 +-
 gdb/testsuite/gdb.linespec/cpcompletion.exp               | 4 ++--
 gdb/testsuite/gdb.linespec/cpexplicit.exp                 | 4 ++--
 gdb/testsuite/gdb.linespec/cpls-abi-tag.exp               | 4 ++--
 gdb/testsuite/gdb.linespec/cpls-ops.exp                   | 4 ++--
 gdb/testsuite/gdb.linespec/errors.exp                     | 2 +-
 gdb/testsuite/gdb.linespec/explicit.exp                   | 4 ++--
 gdb/testsuite/gdb.linespec/keywords.exp                   | 4 ++--
 gdb/testsuite/gdb.linespec/linespec.exp                   | 2 +-
 gdb/testsuite/gdb.linespec/ls-dollar.exp                  | 2 +-
 gdb/testsuite/gdb.linespec/macro-relative.exp             | 2 +-
 gdb/testsuite/gdb.linespec/skip-two.exp                   | 6 +++---
 gdb/testsuite/gdb.linespec/thread.exp                     | 4 ++--
 16 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/gdb/testsuite/gdb.linespec/break-ask.exp b/gdb/testsuite/gdb.linespec/break-ask.exp
index ed91d7defb15..90d5044765e4 100644
--- a/gdb/testsuite/gdb.linespec/break-ask.exp
+++ b/gdb/testsuite/gdb.linespec/break-ask.exp
@@ -40,11 +40,11 @@ with_cwd $srcdir/${subdir}/base/two {
     }
 }
 
 if { [gdb_compile "$srcdir/${subdir}/$srcfile $objfile1 $objfile2" \
 		  $binfile executable $opts] != "" } {
-    return -1
+    return
 }
 
 clean_restart ${testfile}
 
 gdb_test_no_output "set multiple-symbols ask"
diff --git a/gdb/testsuite/gdb.linespec/break-asm-file.exp b/gdb/testsuite/gdb.linespec/break-asm-file.exp
index b8dadc15c4ca..c6ae8dea7be9 100644
--- a/gdb/testsuite/gdb.linespec/break-asm-file.exp
+++ b/gdb/testsuite/gdb.linespec/break-asm-file.exp
@@ -26,26 +26,26 @@ set asm_file0 break-asm-file0.S
 # This test can only be run on targets which support DWARF-2 and use gas.
 require dwarf2_support
 
 if  {[gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile}1.o \
 	  object {debug nowarnings optimize=-O0}] != ""} {
-    return -1
+    return
 }
 
 # Compile .s files without debug information.
 if  {[gdb_compile ${srcdir}/${subdir}/$asm_file0 ${binfile}2.o \
 	  object {nodebug}] != ""} {
-    return -1
+    return
 }
 if  {[gdb_compile ${srcdir}/${subdir}/$asm_file1 ${binfile}3.o \
 	  object {nodebug}] != ""} {
-    return -1
+    return
 }
 
 if  {[gdb_compile [list ${binfile}1.o ${binfile}2.o ${binfile}3.o] \
 	  "${binfile}" executable {}] != ""} {
-    return -1
+    return
 }
 
 clean_restart $execfile
 
 gdb_test "break a/$asm_file0:func" \
diff --git a/gdb/testsuite/gdb.linespec/cp-completion-aliases.exp b/gdb/testsuite/gdb.linespec/cp-completion-aliases.exp
index fe7ae40c9a22..a3f99998840f 100644
--- a/gdb/testsuite/gdb.linespec/cp-completion-aliases.exp
+++ b/gdb/testsuite/gdb.linespec/cp-completion-aliases.exp
@@ -19,11 +19,11 @@
 load_lib completion-support.exp
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 # Disable the completion limit for the whole testcase.
 gdb_test_no_output "set max-completions unlimited"
 
diff --git a/gdb/testsuite/gdb.linespec/cp-replace-typedefs-ns-template.exp b/gdb/testsuite/gdb.linespec/cp-replace-typedefs-ns-template.exp
index b12f14da1543..c82410e29325 100644
--- a/gdb/testsuite/gdb.linespec/cp-replace-typedefs-ns-template.exp
+++ b/gdb/testsuite/gdb.linespec/cp-replace-typedefs-ns-template.exp
@@ -21,11 +21,11 @@ load_lib completion-support.exp
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
 	 {debug c++ additional_flags=-std=c++11}]} {
-    return -1
+    return
 }
 
 # Disable the completion limit for the whole testcase.
 gdb_test_no_output "set max-completions unlimited"
 
diff --git a/gdb/testsuite/gdb.linespec/cpcompletion.exp b/gdb/testsuite/gdb.linespec/cpcompletion.exp
index 14eb1a68c81a..96c7a968ed6c 100644
--- a/gdb/testsuite/gdb.linespec/cpcompletion.exp
+++ b/gdb/testsuite/gdb.linespec/cpcompletion.exp
@@ -28,19 +28,19 @@ lappend opts additional_flags=-std=c++11
 set flags {}
 lappend flags debug
 
 if {[prepare_for_testing "failed to prepare" $testfile \
 	 [list $srcfile $srcfile2 $srcfile3 $srcfile4] $opts]} {
-    return -1
+    return
 }
 
 # Tests below are about tab-completion, which doesn't work if readline
 # library isn't used.  Check it first.
 
 if { ![readline_is_used] } {
     untested "no tab completion support without readline"
-    return -1
+    return
 }
 
 #
 # Some convenience procedures for testing template parameter list
 # completion.
diff --git a/gdb/testsuite/gdb.linespec/cpexplicit.exp b/gdb/testsuite/gdb.linespec/cpexplicit.exp
index b5dbc6dceece..8c9de2aa8991 100644
--- a/gdb/testsuite/gdb.linespec/cpexplicit.exp
+++ b/gdb/testsuite/gdb.linespec/cpexplicit.exp
@@ -20,11 +20,11 @@ require allow_cplus_tests
 standard_testfile .cc
 set exefile $testfile
 
 if {[prepare_for_testing "failed to prepare" $exefile $srcfile \
 	 {c++ debug nowarnings}]} {
-    return -1
+    return
 }
 
 # Wrap this whole test in a namespace to avoid contaminating other tests.
 namespace eval $testfile {
     upvar #0 ::srcfile srcfile
@@ -88,11 +88,11 @@ namespace eval $testfile {
     add linespecs "-function \"myclass::operator,\"" $location(operator)
 
     # Fire up gdb.
     if {![runto_main]} {
 	namespace delete $testfile
-	return -1
+	return
     }
 
     # Test explicit linespecs, with and without conditions.
     foreach linespec $linespecs(linespecs) loc_pattern $linespecs(locations) {
 	# Test the linespec
diff --git a/gdb/testsuite/gdb.linespec/cpls-abi-tag.exp b/gdb/testsuite/gdb.linespec/cpls-abi-tag.exp
index 6399f252d71d..80c8a3937e11 100644
--- a/gdb/testsuite/gdb.linespec/cpls-abi-tag.exp
+++ b/gdb/testsuite/gdb.linespec/cpls-abi-tag.exp
@@ -29,19 +29,19 @@ if { [test_compiler_info gcc-*] } {
     require {expr {[gcc_major_version] >= 5}}
 }
 
 if {[prepare_for_testing "failed to prepare" $testfile \
 	 [list $srcfile] {c++ debug}]} {
-    return -1
+    return
 }
 
 # Tests below are about tab-completion, which doesn't work if readline
 # library isn't used.  Check it first.
 
 if { ![readline_is_used] } {
     untested "no tab completion support without readline"
-    return -1
+    return
 }
 
 gdb_test_no_output "set max-completions unlimited"
 
 # Check that the explicit location completer manages to find the next
diff --git a/gdb/testsuite/gdb.linespec/cpls-ops.exp b/gdb/testsuite/gdb.linespec/cpls-ops.exp
index 4cef26e6767e..c49afaa9856c 100644
--- a/gdb/testsuite/gdb.linespec/cpls-ops.exp
+++ b/gdb/testsuite/gdb.linespec/cpls-ops.exp
@@ -23,19 +23,19 @@ set flags {}
 lappend flags debug
 lappend flags c++
 
 if {[prepare_for_testing "failed to prepare" $testfile \
 	 [list $srcfile] $flags]} {
-    return -1
+    return
 }
 
 # Tests below are about tab-completion, which doesn't work if readline
 # library isn't used.  Check it first.
 
 if { ![readline_is_used] } {
     untested "no tab completion support without readline"
-    return -1
+    return
 }
 
 gdb_test_no_output "set max-completions unlimited"
 
 # Check that the explicit location completer manages to find the next
diff --git a/gdb/testsuite/gdb.linespec/errors.exp b/gdb/testsuite/gdb.linespec/errors.exp
index 8f60f0eca30b..8e69dd6fa058 100644
--- a/gdb/testsuite/gdb.linespec/errors.exp
+++ b/gdb/testsuite/gdb.linespec/errors.exp
@@ -17,11 +17,11 @@
 
 # We don't currently need our own test case for testing, so grab
 # another one.
 
 if {[prepare_for_testing "failed to prepare" linespecs keywords.c]} {
-  return -1
+    return
 }
 
 # PR gdb/12843
 gdb_test "list c:/foo/bar/baz.c:1" "No source file named c:/foo/bar/baz.c."
 gdb_test "list c:/foo/bar/baz.c" "Function \"c:/foo/bar/baz.c\" not defined."
diff --git a/gdb/testsuite/gdb.linespec/explicit.exp b/gdb/testsuite/gdb.linespec/explicit.exp
index faee27bab4a5..ccf74d3863d6 100644
--- a/gdb/testsuite/gdb.linespec/explicit.exp
+++ b/gdb/testsuite/gdb.linespec/explicit.exp
@@ -25,11 +25,11 @@ lappend opts debug
 lappend opts nowarnings
 lappend opts additional_flags=-nostdlib
 
 if {[prepare_for_testing "failed to prepare" $exefile \
 	 [list $srcfile $srcfile2 $srcfile3] $opts]} {
-    return -1
+    return
 }
 
 # Wrap the entire test in a namespace to avoid contaminating other tests.
 namespace eval $testfile {
     upvar #0 ::srcfile srcfile
@@ -96,11 +96,11 @@ namespace eval $testfile {
     add linespecs "-function myfunction -label top -line 3" $location(top)
     add linespecs "-line 25" $location(normal)
 
     # Fire up gdb.
     if {![runto_main]} {
-	return -1
+	return
     }
 
     # Turn off queries
     gdb_test_no_output "set confirm off"
 
diff --git a/gdb/testsuite/gdb.linespec/keywords.exp b/gdb/testsuite/gdb.linespec/keywords.exp
index 36069868f444..ae9380575cf6 100644
--- a/gdb/testsuite/gdb.linespec/keywords.exp
+++ b/gdb/testsuite/gdb.linespec/keywords.exp
@@ -17,15 +17,15 @@
 
 standard_testfile
 set exefile $testfile
 
 if {[prepare_for_testing "failed to prepare" $exefile $srcfile {debug}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
-    return 0
+    return
 }
 
 # Turn off pending breakpoints to facilitate testing errors.
 gdb_test_no_output "set breakpoint pending off"
 
diff --git a/gdb/testsuite/gdb.linespec/linespec.exp b/gdb/testsuite/gdb.linespec/linespec.exp
index 0345fc5098ef..771dede9bb64 100644
--- a/gdb/testsuite/gdb.linespec/linespec.exp
+++ b/gdb/testsuite/gdb.linespec/linespec.exp
@@ -25,11 +25,11 @@ set basetwo base/two/thefile.cc
 require allow_cplus_tests
 
 if {[prepare_for_testing "failed to prepare" $exefile \
 	 [list $srcfile $baseone $basetwo] \
 	 {debug nowarnings c++}]} {
-    return -1
+    return
 }
 
 gdb_test_no_output "set multiple-symbols all" \
     "set multiple-symbols to all for linespec tests"
 
diff --git a/gdb/testsuite/gdb.linespec/ls-dollar.exp b/gdb/testsuite/gdb.linespec/ls-dollar.exp
index 584ea35447e4..a000c5b39695 100644
--- a/gdb/testsuite/gdb.linespec/ls-dollar.exp
+++ b/gdb/testsuite/gdb.linespec/ls-dollar.exp
@@ -20,11 +20,11 @@ set exefile $testfile
 
 require allow_cplus_tests
 
 if {[prepare_for_testing "failed to prepare" $exefile $srcfile \
 	 {debug nowarnings c++}]} {
-    return -1
+    return
 }
 
 gdb_test_no_output "set listsize 1"
 
 set line [gdb_get_line_number {dollar_func}]
diff --git a/gdb/testsuite/gdb.linespec/macro-relative.exp b/gdb/testsuite/gdb.linespec/macro-relative.exp
index b0ac538be69d..99a6dac78921 100644
--- a/gdb/testsuite/gdb.linespec/macro-relative.exp
+++ b/gdb/testsuite/gdb.linespec/macro-relative.exp
@@ -40,9 +40,9 @@ clean_restart ${testfile}
 
 # Test macros respect DW_AT_comp_dir.
 
 # "list header_two_func" does not set exactly the one line we want.
 if {![runto header_two_func]} {
-    return -1
+    return
 }
 
 gdb_test "info macro HEADER" "\r\n#define HEADER 2"
diff --git a/gdb/testsuite/gdb.linespec/skip-two.exp b/gdb/testsuite/gdb.linespec/skip-two.exp
index 0a8af84441a3..3c5e438f1177 100644
--- a/gdb/testsuite/gdb.linespec/skip-two.exp
+++ b/gdb/testsuite/gdb.linespec/skip-two.exp
@@ -23,18 +23,18 @@ set basetwo base/two/thefile.cc
 require allow_cplus_tests
 
 if {[prepare_for_testing "failed to prepare" $execfile \
 	 [list $srcfile $baseone $basetwo] \
 	 {debug nowarnings c++}]} {
-    return -1
+    return
 }
 
 gdb_test "skip function dupname" \
 	 {Function dupname will be skipped when stepping\.}
 
 if {![runto_main]} {
-    return -1
+    return
 }
 
 set test "dupname ignored from main"
 gdb_test_multiple "step" $test {
     -re "^step\r\ndupname .*\r\n$gdb_prompt $" {
@@ -62,11 +62,11 @@ gdb_test_no_output "skip delete 1"
 
 gdb_test "skip file thefile.cc" \
 	 {File thefile\.cc will be skipped when stepping\.}
 
 if {![runto_main]} {
-    return -1
+    return
 }
 
 gdb_test "step" "static int dupname .*" "step into dupname"
 gdb_test "finish" "return dupname.* body_elsewhere.*" "finish from dupname"
 
diff --git a/gdb/testsuite/gdb.linespec/thread.exp b/gdb/testsuite/gdb.linespec/thread.exp
index 30a21e8fe2fd..ab63fe52a1d9 100644
--- a/gdb/testsuite/gdb.linespec/thread.exp
+++ b/gdb/testsuite/gdb.linespec/thread.exp
@@ -18,15 +18,15 @@
 
 standard_testfile
 set exefile $testfile
 
 if {[prepare_for_testing "failed to prepare" $exefile $srcfile {debug}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
-    return 0
+    return
 }
 
 set bp_location1 [gdb_get_line_number "set breakpoint 1 here"]
 
 gdb_test "break $srcfile:$bp_location1" \

  parent reply	other threads:[~2026-04-29 23:08 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-29 23:03 [PATCH v2 00/37] GDB: testsuite: Fix top-level returns Thiago Jung Bauermann
2026-04-29 23:03 ` [PATCH v2 01/37] GDB: testsuite: aarch64, arm: Don't return value from top-level (sed) Thiago Jung Bauermann
2026-04-29 23:03 ` [PATCH v2 02/37] GDB: testsuite: aarch64, arm: Don't return value from top-level (manual) Thiago Jung Bauermann
2026-04-29 23:03 ` [PATCH v2 03/37] GDB: testsuite: x86, amd64, i386, ia64: Don't return value from top-level (sed) Thiago Jung Bauermann
2026-04-29 23:03 ` [PATCH v2 04/37] GDB: testsuite: x86, amd64, i386: Don't return value from top-level (manual) Thiago Jung Bauermann
2026-04-29 23:03 ` [PATCH v2 05/37] GDB: testsuite: powerpc: Don't return value from top-level (sed) Thiago Jung Bauermann
2026-04-29 23:03 ` [PATCH v2 06/37] GDB: testsuite: powerpc: Don't return value from top-level (manual) Thiago Jung Bauermann
2026-04-29 23:03 ` [PATCH v2 07/37] GDB: testsuite: riscv: Don't return value from top-level (sed) Thiago Jung Bauermann
2026-04-29 23:03 ` [PATCH v2 08/37] GDB: testsuite: riscv: Don't return value from top-level (manual) Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 09/37] GDB: testsuite: s390: Don't return value from top-level (sed) Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 10/37] GDB: testsuite: sparc: " Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 11/37] GDB: testsuite: Don't return value from top-level in tests of various arches Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 12/37] GDB: testsuite: Don't return value from top-level in multi-arch tests Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 13/37] GDB: testsuite: base: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 14/37] GDB: testsuite: base: Don't return 0 " Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 15/37] GDB: testsuite: base: Don't return value from top-level (manual) Thiago Jung Bauermann
2026-05-08 22:01   ` Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 16/37] GDB: testsuite: C++: Don't return value from top-level (sed) Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 17/37] GDB: testsuite: C++: Don't return value from top-level (manual) Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 18/37] GDB: testsuite: DWARF: Don't return value from top-level (sed) Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 19/37] GDB: testsuite: DWARF: Don't return -1 from top-level (manual) Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 20/37] GDB: testsuite: GDB: Don't return -1 from top-level Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 21/37] GDB: testsuite: Guile: " Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 22/37] GDB: testsuite: Python: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 23/37] GDB: testsuite: Python: Don't return 0 " Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 24/37] GDB: testsuite: Python: Don't return value from top-level (manual) Thiago Jung Bauermann
2026-04-29 23:04 ` Thiago Jung Bauermann [this message]
2026-04-29 23:04 ` [PATCH v2 26/37] GDB: testsuite: MI: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 27/37] GDB: testsuite: MI: Don't return value from top-level (manual) Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 28/37] GDB: testsuite: reverse: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 29/37] GDB: testsuite: reverse: Don't return value from top-level (manual) Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 30/37] GDB: testsuite: server: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 31/37] GDB: testsuite: server: Don't return value from top-level (manual) Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 32/37] GDB: testsuite: threads: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 33/37] GDB: testsuite: threads: Don't return 0 " Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 34/37] GDB: testsuite: threads: Don't return value from top-level (manual) Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 35/37] GDB: testsuite: TUI: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 36/37] GDB: testsuite: TUI: Don't return 0 from top-level (manual) Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 37/37] GDB: testsuite: XML: Don't return -1 nor 0 from top-level Thiago Jung Bauermann
2026-05-08 17:47 ` [PATCH v2 00/37] GDB: testsuite: Fix top-level returns Tom Tromey
2026-05-08 22:06   ` 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=20260429230432.60487-26-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