]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
GDB: testsuite: linespec: Don't return value from top-level
authorThiago Jung Bauermann <thiago.bauermann@linaro.org>
Wed, 29 Apr 2026 23:04:16 +0000 (20:04 -0300)
committerThiago Jung Bauermann <thiago.bauermann@linaro.org>
Fri, 8 May 2026 21:55:59 +0000 (18:55 -0300)
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 <tom@tromey.com>
16 files changed:
gdb/testsuite/gdb.linespec/break-ask.exp
gdb/testsuite/gdb.linespec/break-asm-file.exp
gdb/testsuite/gdb.linespec/cp-completion-aliases.exp
gdb/testsuite/gdb.linespec/cp-replace-typedefs-ns-template.exp
gdb/testsuite/gdb.linespec/cpcompletion.exp
gdb/testsuite/gdb.linespec/cpexplicit.exp
gdb/testsuite/gdb.linespec/cpls-abi-tag.exp
gdb/testsuite/gdb.linespec/cpls-ops.exp
gdb/testsuite/gdb.linespec/errors.exp
gdb/testsuite/gdb.linespec/explicit.exp
gdb/testsuite/gdb.linespec/keywords.exp
gdb/testsuite/gdb.linespec/linespec.exp
gdb/testsuite/gdb.linespec/ls-dollar.exp
gdb/testsuite/gdb.linespec/macro-relative.exp
gdb/testsuite/gdb.linespec/skip-two.exp
gdb/testsuite/gdb.linespec/thread.exp

index ed91d7defb153bb38e8d44f7f27dde111e6f6bcc..90d5044765e4a24ed13af6b39a63651722800a9c 100644 (file)
@@ -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}
index b8dadc15c4caca37af23a18f64ec997ede244ab0..c6ae8dea7be9f08841ffe8640da526c39f683f98 100644 (file)
@@ -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
index fe7ae40c9a22e478bf9ab6dd335333fc5d4c644e..a3f99998840f766dcafeaa50a617592dbf741568 100644 (file)
@@ -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.
index b12f14da15434eb0a976a53f16085188ef419ed2..c82410e29325d35784bf16cadcd1d517b4ace70f 100644 (file)
@@ -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.
index 14eb1a68c81a9301bf850c510ea1d84b3beb4124..96c7a968ed6c00a43e16163fb17a850c74c430cd 100644 (file)
@@ -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
 }
 
 #
index b5dbc6dceece8259f50201b861dff895cbc3c70a..8c9de2aa899162756c2d9cdd9a6681e22f201b1c 100644 (file)
@@ -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.
index 6399f252d71d6d774be10eab725a61dfa12b8e8f..80c8a3937e11fa5142ee7ab41ae20e4dc3f2e5ed 100644 (file)
@@ -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"
index 4cef26e6767e7940fbaa3e1eadca34342ae04dd7..c49afaa9856c7e9c65a924091f3a97145c0f13c7 100644 (file)
@@ -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"
index 8f60f0eca30ba3641b94caf8277002efce4fc1d3..8e69dd6fa05824d4c130e265775f9098ac267d20 100644 (file)
@@ -19,7 +19,7 @@
 # another one.
 
 if {[prepare_for_testing "failed to prepare" linespecs keywords.c]} {
-  return -1
+    return
 }
 
 # PR gdb/12843
index faee27bab4a5b7c56401bff5dfe758447862cd1d..ccf74d3863d6df6269ed18af286b453e03b96907 100644 (file)
@@ -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
index 36069868f4449936358fd3c987dd13ebc7a05f55..ae9380575cf64263887a81ba4d324cb16897ef1c 100644 (file)
@@ -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.
index 0345fc5098ef3664c28374ff28ac658854eda55a..771dede9bb64cced39edefe7be12dd51f94f915f 100644 (file)
@@ -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" \
index 584ea35447e418987f3b66f001bfaa28021204cb..a000c5b39695968f590ebb16918e75ae105f7013 100644 (file)
@@ -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"
index b0ac538be69dff756e7332545feca3a5f42b81c4..99a6dac789219d21deb3ad74509db763a14e9c33 100644 (file)
@@ -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"
index 0a8af84441a35fdc324f2b15d0fb0a435a60d1d0..3c5e438f117773b6c6aa086b1d717ba931bf11de 100644 (file)
@@ -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"
index 30a21e8fe2fd21a627027109bc558cbda78fc649..ab63fe52a1d96297af568c1d634e72253e5a0556 100644 (file)
@@ -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"]