[binutils-gdb] GDB: testsuite: linespec: Don't return value from top-level

Thiago Bauermann via Gdb-cvs <[email protected]>
Newsgroups gmane.comp.gdb.cvs
Message-ID <[email protected]>
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d185748efaaf06739636d58498ab48e3a64f4a78

commit d185748efaaf06739636d58498ab48e3a64f4a78
Author: Thiago Jung Bauermann <[email protected]>
Date:   Wed Apr 29 20:04:16 2026 -0300

    GDB: testsuite: linespec: Don't return value from top-level
    
    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.
    
    Approved-By: Tom Tromey <[email protected]>

Diff:
---
 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/testsuite/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 ed91d7defb1..90d5044765e 100644
--- a/gdb/testsuite/gdb.linespec/break-ask.exp
+++ b/gdb/testsuite/gdb.linespec/break-ask.exp
@@ -42,7 +42,7 @@ with_cwd $srcdir/${subdir}/base/two {
 
 if { [gdb_compile "$srcdir/${subdir}/$srcfile $objfile1 $objfile2" \
 		  $binfile executable $opts] != "" } {
-    return -1
+    return
 }
 
 clean_restart ${testfile}
diff --git a/gdb/testsuite/gdb.linespec/break-asm-file.exp b/gdb/testsuite/gdb.linespec/break-asm-file.exp
index b8dadc15c4c..c6ae8dea7be 100644
--- a/gdb/testsuite/gdb.linespec/break-asm-file.exp
+++ b/gdb/testsuite/gdb.linespec/break-asm-file.exp
@@ -28,22 +28,22 @@ 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
diff --git a/gdb/testsuite/gdb.linespec/cp-completion-aliases.exp b/gdb/testsuite/gdb.linespec/cp-completion-aliases.exp
index fe7ae40c9a2..a3f99998840 100644
--- a/gdb/testsuite/gdb.linespec/cp-completion-aliases.exp
+++ b/gdb/testsuite/gdb.linespec/cp-completion-aliases.exp
@@ -21,7 +21,7 @@ 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.
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 b12f14da154..c82410e2932 100644
--- a/gdb/testsuite/gdb.linespec/cp-replace-typedefs-ns-template.exp
+++ b/gdb/testsuite/gdb.linespec/cp-replace-typedefs-ns-template.exp
@@ -23,7 +23,7 @@ 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.
diff --git a/gdb/testsuite/gdb.linespec/cpcompletion.exp b/gdb/testsuite/gdb.linespec/cpcompletion.exp
index 14eb1a68c81..96c7a968ed6 100644
--- a/gdb/testsuite/gdb.linespec/cpcompletion.exp
+++ b/gdb/testsuite/gdb.linespec/cpcompletion.exp
@@ -30,7 +30,7 @@ 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
@@ -38,7 +38,7 @@ if {[prepare_for_testing "failed to prepare" $testfile \
 
 if { ![readline_is_used] } {
     untested "no tab completion support without readline"
-    return -1
+    return
 }
 
 #
diff --git a/gdb/testsuite/gdb.linespec/cpexplicit.exp b/gdb/testsuite/gdb.linespec/cpexplicit.exp
index b5dbc6dceec..8c9de2aa899 100644
--- a/gdb/testsuite/gdb.linespec/cpexplicit.exp
+++ b/gdb/testsuite/gdb.linespec/cpexplicit.exp
@@ -22,7 +22,7 @@ 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.
@@ -90,7 +90,7 @@ namespace eval $testfile {
     # Fire up gdb.
     if {![runto_main]} {
 	namespace delete $testfile
-	return -1
+	return
     }
 
     # Test explicit linespecs, with and without conditions.
diff --git a/gdb/testsuite/gdb.linespec/cpls-abi-tag.exp b/gdb/testsuite/gdb.linespec/cpls-abi-tag.exp
index 6399f252d71..80c8a3937e1 100644
--- a/gdb/testsuite/gdb.linespec/cpls-abi-tag.exp
+++ b/gdb/testsuite/gdb.linespec/cpls-abi-tag.exp
@@ -31,7 +31,7 @@ if { [test_compiler_info gcc-*] } {
 
 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
@@ -39,7 +39,7 @@ if {[prepare_for_testing "failed to prepare" $testfile \
 
 if { ![readline_is_used] } {
     untested "no tab completion support without readline"
-    return -1
+    return
 }
 
 gdb_test_no_output "set max-completions unlimited"
diff --git a/gdb/testsuite/gdb.linespec/cpls-ops.exp b/gdb/testsuite/gdb.linespec/cpls-ops.exp
index 4cef26e6767..c49afaa9856 100644
--- a/gdb/testsuite/gdb.linespec/cpls-ops.exp
+++ b/gdb/testsuite/gdb.linespec/cpls-ops.exp
@@ -25,7 +25,7 @@ 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
@@ -33,7 +33,7 @@ if {[prepare_for_testing "failed to prepare" $testfile \
 
 if { ![readline_is_used] } {
     untested "no tab completion support without readline"
-    return -1
+    return
 }
 
 gdb_test_no_output "set max-completions unlimited"
diff --git a/gdb/testsuite/gdb.linespec/errors.exp b/gdb/testsuite/gdb.linespec/errors.exp
index 8f60f0eca30..8e69dd6fa05 100644
--- a/gdb/testsuite/gdb.linespec/errors.exp
+++ b/gdb/testsuite/gdb.linespec/errors.exp
@@ -19,7 +19,7 @@
 # another one.
 
 if {[prepare_for_testing "failed to prepare" linespecs keywords.c]} {
-  return -1
+    return
 }
 
 # PR gdb/12843
diff --git a/gdb/testsuite/gdb.linespec/explicit.exp b/gdb/testsuite/gdb.linespec/explicit.exp
index faee27bab4a..ccf74d3863d 100644
--- a/gdb/testsuite/gdb.linespec/explicit.exp
+++ b/gdb/testsuite/gdb.linespec/explicit.exp
@@ -27,7 +27,7 @@ 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.
@@ -98,7 +98,7 @@ namespace eval $testfile {
 
     # Fire up gdb.
     if {![runto_main]} {
-	return -1
+	return
     }
 
     # Turn off queries
diff --git a/gdb/testsuite/gdb.linespec/keywords.exp b/gdb/testsuite/gdb.linespec/keywords.exp
index 36069868f44..ae9380575cf 100644
--- a/gdb/testsuite/gdb.linespec/keywords.exp
+++ b/gdb/testsuite/gdb.linespec/keywords.exp
@@ -19,11 +19,11 @@ 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.
diff --git a/gdb/testsuite/gdb.linespec/linespec.exp b/gdb/testsuite/gdb.linespec/linespec.exp
index 0345fc5098e..771dede9bb6 100644
--- a/gdb/testsuite/gdb.linespec/linespec.exp
+++ b/gdb/testsuite/gdb.linespec/linespec.exp
@@ -27,7 +27,7 @@ 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" \
diff --git a/gdb/testsuite/gdb.linespec/ls-dollar.exp b/gdb/testsuite/gdb.linespec/ls-dollar.exp
index 584ea35447e..a000c5b3969 100644
--- a/gdb/testsuite/gdb.linespec/ls-dollar.exp
+++ b/gdb/testsuite/gdb.linespec/ls-dollar.exp
@@ -22,7 +22,7 @@ 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"
diff --git a/gdb/testsuite/gdb.linespec/macro-relative.exp b/gdb/testsuite/gdb.linespec/macro-relative.exp
index b0ac538be69..99a6dac7892 100644
--- a/gdb/testsuite/gdb.linespec/macro-relative.exp
+++ b/gdb/testsuite/gdb.linespec/macro-relative.exp
@@ -42,7 +42,7 @@ clean_restart ${testfile}
 
 # "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 0a8af84441a..3c5e438f117 100644
--- a/gdb/testsuite/gdb.linespec/skip-two.exp
+++ b/gdb/testsuite/gdb.linespec/skip-two.exp
@@ -25,14 +25,14 @@ 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"
@@ -64,7 +64,7 @@ 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"
diff --git a/gdb/testsuite/gdb.linespec/thread.exp b/gdb/testsuite/gdb.linespec/thread.exp
index 30a21e8fe2f..ab63fe52a1d 100644
--- a/gdb/testsuite/gdb.linespec/thread.exp
+++ b/gdb/testsuite/gdb.linespec/thread.exp
@@ -20,11 +20,11 @@ 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"]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.