[binutils-gdb] GDB: testsuite: Python: Don't return 0 from top-level (sed)

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=55138d617d5c940ff3b24b3fef4d4a037e0da922

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

    GDB: testsuite: Python: Don't return 0 from top-level (sed)
    
    This patch is purely the result of running:
    
    $ sed -i 's/^    return -1/    return/' *.exp*
    
    inside gdb/testsuite/gdb.python.  A couple of false positives weren't
    included.
    
    Approved-By: Tom Tromey <[email protected]>

Diff:
---
 gdb/testsuite/gdb.python/lib-types.exp              | 2 +-
 gdb/testsuite/gdb.python/py-as-string.exp           | 2 +-
 gdb/testsuite/gdb.python/py-block.exp               | 2 +-
 gdb/testsuite/gdb.python/py-caller-is.exp           | 2 +-
 gdb/testsuite/gdb.python/py-cmd.exp                 | 2 +-
 gdb/testsuite/gdb.python/py-commands-breakpoint.exp | 2 +-
 gdb/testsuite/gdb.python/py-connection.exp          | 2 +-
 gdb/testsuite/gdb.python/py-error.exp               | 2 +-
 gdb/testsuite/gdb.python/py-finish-breakpoint2.exp  | 2 +-
 gdb/testsuite/gdb.python/py-frame-inline.exp        | 2 +-
 gdb/testsuite/gdb.python/py-frame.exp               | 4 ++--
 gdb/testsuite/gdb.python/py-inferior.exp            | 2 +-
 gdb/testsuite/gdb.python/py-infthread.exp           | 2 +-
 gdb/testsuite/gdb.python/py-missing-objfile.exp     | 2 +-
 gdb/testsuite/gdb.python/py-objfile.exp             | 4 ++--
 gdb/testsuite/gdb.python/py-pending-frame-level.exp | 2 +-
 gdb/testsuite/gdb.python/py-rbreak.exp              | 2 +-
 gdb/testsuite/gdb.python/py-recurse-unwind.exp      | 2 +-
 gdb/testsuite/gdb.python/py-shared.exp              | 2 +-
 gdb/testsuite/gdb.python/py-strfns.exp              | 2 +-
 gdb/testsuite/gdb.python/py-symbol.exp              | 6 +++---
 gdb/testsuite/gdb.python/py-symtab.exp              | 2 +-
 gdb/testsuite/gdb.python/py-unwind-inline.exp       | 2 +-
 gdb/testsuite/gdb.python/py-unwind-user-regs.exp    | 2 +-
 gdb/testsuite/gdb.python/py-unwind.exp              | 2 +-
 gdb/testsuite/gdb.python/py-value.exp               | 2 +-
 gdb/testsuite/gdb.python/python.exp                 | 6 +++---
 27 files changed, 33 insertions(+), 33 deletions(-)

diff --git a/gdb/testsuite/gdb.python/lib-types.exp b/gdb/testsuite/gdb.python/lib-types.exp
index aa281c6443d..d2e7d391a77 100644
--- a/gdb/testsuite/gdb.python/lib-types.exp
+++ b/gdb/testsuite/gdb.python/lib-types.exp
@@ -27,7 +27,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
 }
 
 if {![runto_main]} {
-    return 0
+    return
 }
 
 gdb_test_no_output "python import gdb.types"
diff --git a/gdb/testsuite/gdb.python/py-as-string.exp b/gdb/testsuite/gdb.python/py-as-string.exp
index 3dc858db1ad..41cefbe0411 100644
--- a/gdb/testsuite/gdb.python/py-as-string.exp
+++ b/gdb/testsuite/gdb.python/py-as-string.exp
@@ -27,7 +27,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
 }
 
 if {![runto_main]} {
-    return 0
+    return
 }
 
 proc test_as_string { } {
diff --git a/gdb/testsuite/gdb.python/py-block.exp b/gdb/testsuite/gdb.python/py-block.exp
index b0123c4d3b5..30983ac35f2 100644
--- a/gdb/testsuite/gdb.python/py-block.exp
+++ b/gdb/testsuite/gdb.python/py-block.exp
@@ -27,7 +27,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
 }
 
 if {![runto_main]} {
-    return 0
+    return
 }
 
 global hex decimal
diff --git a/gdb/testsuite/gdb.python/py-caller-is.exp b/gdb/testsuite/gdb.python/py-caller-is.exp
index e195e42a8ca..d9b826cb6a2 100644
--- a/gdb/testsuite/gdb.python/py-caller-is.exp
+++ b/gdb/testsuite/gdb.python/py-caller-is.exp
@@ -27,7 +27,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
 }
 
 if {![runto_main]} {
-    return 0
+    return
 }
 
 gdb_breakpoint "bottom_func"
diff --git a/gdb/testsuite/gdb.python/py-cmd.exp b/gdb/testsuite/gdb.python/py-cmd.exp
index 766a594d2f4..0bda3cdc934 100644
--- a/gdb/testsuite/gdb.python/py-cmd.exp
+++ b/gdb/testsuite/gdb.python/py-cmd.exp
@@ -27,7 +27,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
 }
 
 if {![runto_main]} {
-    return 0
+    return
 }
 
 # Test a simple command.
diff --git a/gdb/testsuite/gdb.python/py-commands-breakpoint.exp b/gdb/testsuite/gdb.python/py-commands-breakpoint.exp
index 2b3842c816f..1afb41c80ea 100644
--- a/gdb/testsuite/gdb.python/py-commands-breakpoint.exp
+++ b/gdb/testsuite/gdb.python/py-commands-breakpoint.exp
@@ -26,7 +26,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
 }
 
 if { ![runto_main] } {
-    return 0
+    return
 }
 
 set host_python_file \
diff --git a/gdb/testsuite/gdb.python/py-connection.exp b/gdb/testsuite/gdb.python/py-connection.exp
index e520e91368a..7f3b46eff79 100644
--- a/gdb/testsuite/gdb.python/py-connection.exp
+++ b/gdb/testsuite/gdb.python/py-connection.exp
@@ -29,7 +29,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
 }
 
 if {![runto_main]} {
-    return 0
+    return
 }
 
 if { [target_info exists gdb_protocol] } {
diff --git a/gdb/testsuite/gdb.python/py-error.exp b/gdb/testsuite/gdb.python/py-error.exp
index 583e63571a4..3285746a47c 100644
--- a/gdb/testsuite/gdb.python/py-error.exp
+++ b/gdb/testsuite/gdb.python/py-error.exp
@@ -44,7 +44,7 @@ gdb_test_multiple $test $test {
 }
 
 if {$test2 == ""} {
-    return 0
+    return
 }
 
 set remote_python_file [gdb_remote_download host \
diff --git a/gdb/testsuite/gdb.python/py-finish-breakpoint2.exp b/gdb/testsuite/gdb.python/py-finish-breakpoint2.exp
index d782c577cfc..9fa3faa7b9f 100644
--- a/gdb/testsuite/gdb.python/py-finish-breakpoint2.exp
+++ b/gdb/testsuite/gdb.python/py-finish-breakpoint2.exp
@@ -27,7 +27,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
 }
 
 if {![runto_main]} {
-    return 0
+    return
 }
 
 set pyfile [gdb_remote_download host \
diff --git a/gdb/testsuite/gdb.python/py-frame-inline.exp b/gdb/testsuite/gdb.python/py-frame-inline.exp
index a44136990c0..c90aed09e67 100644
--- a/gdb/testsuite/gdb.python/py-frame-inline.exp
+++ b/gdb/testsuite/gdb.python/py-frame-inline.exp
@@ -24,7 +24,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
 }
 
 if {![runto_main]} {
-    return 0
+    return
 }
 
 gdb_breakpoint [gdb_get_line_number "break-here"]
diff --git a/gdb/testsuite/gdb.python/py-frame.exp b/gdb/testsuite/gdb.python/py-frame.exp
index 92a0ef3f7eb..ca350cf03c2 100644
--- a/gdb/testsuite/gdb.python/py-frame.exp
+++ b/gdb/testsuite/gdb.python/py-frame.exp
@@ -29,7 +29,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
 # The following tests require execution.
 
 if {![runto_main]} {
-    return 0
+    return
 }
 
 gdb_breakpoint [gdb_get_line_number "Block break here."]
@@ -210,7 +210,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {}] } {
 }
 
 if {![runto_main]} {
-    return 0
+    return
 }
 
 # Test if Frame.static_link works for a frame without debug info.
diff --git a/gdb/testsuite/gdb.python/py-inferior.exp b/gdb/testsuite/gdb.python/py-inferior.exp
index 8479427f726..f69ad8fc0d8 100644
--- a/gdb/testsuite/gdb.python/py-inferior.exp
+++ b/gdb/testsuite/gdb.python/py-inferior.exp
@@ -62,7 +62,7 @@ gdb_test "python \
 # The following tests require execution.
 
 if {![runto_main]} {
-    return 0
+    return
 }
 
 # The most recently added inferior.
diff --git a/gdb/testsuite/gdb.python/py-infthread.exp b/gdb/testsuite/gdb.python/py-infthread.exp
index 65ccc8f9a9e..93022e8ade3 100644
--- a/gdb/testsuite/gdb.python/py-infthread.exp
+++ b/gdb/testsuite/gdb.python/py-infthread.exp
@@ -40,7 +40,7 @@ gdb_test_multiline "install new_thread event handler" \
 # The following tests require execution.
 
 if {![runto_main]} {
-    return 0
+    return
 }
 
 gdb_test "python print(seen_a_thread)" "True"
diff --git a/gdb/testsuite/gdb.python/py-missing-objfile.exp b/gdb/testsuite/gdb.python/py-missing-objfile.exp
index e5e086130b0..907bdec76f4 100644
--- a/gdb/testsuite/gdb.python/py-missing-objfile.exp
+++ b/gdb/testsuite/gdb.python/py-missing-objfile.exp
@@ -56,7 +56,7 @@ set remote_python_file \
 set corefile [core_find $binfile {}]
 if {$corefile == ""} {
     unsupported "core file not generated"
-    return 0
+    return
 }
 
 # Create a directory named DIRNAME for use as the
diff --git a/gdb/testsuite/gdb.python/py-objfile.exp b/gdb/testsuite/gdb.python/py-objfile.exp
index 0127b82936c..64c62602930 100644
--- a/gdb/testsuite/gdb.python/py-objfile.exp
+++ b/gdb/testsuite/gdb.python/py-objfile.exp
@@ -27,7 +27,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
 }
 
 if {![runto_main]} {
-    return 0
+    return
 }
 
 set python_error_text "Error occurred in Python.*"
@@ -120,7 +120,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile}2 ${srcfile} {nodebug l
 }
 
 if {![runto_main]} {
-    return 0
+    return
 }
 
 gdb_py_test_silent_cmd "python objfile = gdb.objfiles()\[0\]" \
diff --git a/gdb/testsuite/gdb.python/py-pending-frame-level.exp b/gdb/testsuite/gdb.python/py-pending-frame-level.exp
index 204c7c36c54..0e10b8065d1 100644
--- a/gdb/testsuite/gdb.python/py-pending-frame-level.exp
+++ b/gdb/testsuite/gdb.python/py-pending-frame-level.exp
@@ -26,7 +26,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
 }
 
 if {![runto_main]} {
-    return 0
+    return
 }
 
 set pyfile [gdb_remote_download host ${srcdir}/${subdir}/${testfile}.py]
diff --git a/gdb/testsuite/gdb.python/py-rbreak.exp b/gdb/testsuite/gdb.python/py-rbreak.exp
index eead513caeb..ba02758ae79 100644
--- a/gdb/testsuite/gdb.python/py-rbreak.exp
+++ b/gdb/testsuite/gdb.python/py-rbreak.exp
@@ -27,7 +27,7 @@ if {[prepare_for_testing "failed to prepare" ${testfile} [list $srcfile $srcfile
 }
 
 if {![runto_main]} {
-    return 0
+    return
 }
 
 gdb_test_no_output "nosharedlibrary"
diff --git a/gdb/testsuite/gdb.python/py-recurse-unwind.exp b/gdb/testsuite/gdb.python/py-recurse-unwind.exp
index 4df47a6e8b4..25cefc9b87e 100644
--- a/gdb/testsuite/gdb.python/py-recurse-unwind.exp
+++ b/gdb/testsuite/gdb.python/py-recurse-unwind.exp
@@ -40,7 +40,7 @@ gdb_test "source ${pyfile}" "Python script imported" \
 # The following tests require execution.
 
 if {![runto_main]} {
-    return 0
+    return
 }
 
 
diff --git a/gdb/testsuite/gdb.python/py-shared.exp b/gdb/testsuite/gdb.python/py-shared.exp
index 0eef359d0b8..ff47270c071 100644
--- a/gdb/testsuite/gdb.python/py-shared.exp
+++ b/gdb/testsuite/gdb.python/py-shared.exp
@@ -44,7 +44,7 @@ gdb_load_shlib ${library}
 # The following tests require execution.
 
 if {![runto_main]} {
-    return 0
+    return
 }
 
 runto [gdb_get_line_number "Break to end."]
diff --git a/gdb/testsuite/gdb.python/py-strfns.exp b/gdb/testsuite/gdb.python/py-strfns.exp
index 539ba984db0..3a8610a971e 100644
--- a/gdb/testsuite/gdb.python/py-strfns.exp
+++ b/gdb/testsuite/gdb.python/py-strfns.exp
@@ -27,7 +27,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
 }
 
 if {![runto_main]} {
-    return 0
+    return
 }
 
 proc test_all_strfns { } {
diff --git a/gdb/testsuite/gdb.python/py-symbol.exp b/gdb/testsuite/gdb.python/py-symbol.exp
index 90e724ca031..af187857176 100644
--- a/gdb/testsuite/gdb.python/py-symbol.exp
+++ b/gdb/testsuite/gdb.python/py-symbol.exp
@@ -90,7 +90,7 @@ gdb_test "python print (gdb.lookup_static_symbol ('qq') is None)" \
     "True" "lookup_static_symbol for global var"
 
 if {![runto_main]} {
-    return 0
+    return
 }
 
 global hex decimal
@@ -205,7 +205,7 @@ gdb_test "python print (gdb.lookup_static_symbol ('(anonymous namespace)::anon')
     "10" "print value of anon"
 
 if {![runto_main]} {
-    return 0
+    return
 }
 
 gdb_breakpoint [gdb_get_line_number "Break in class."]
@@ -233,7 +233,7 @@ gdb_test "python print (cplusfunc.addr_class == gdb.SYMBOL_LOC_BLOCK)" "True" "t
 # Start with a fresh gdb.
 clean_restart ${::testfile}
 if {![runto_main]} {
-    return 0
+    return
 }
 
 gdb_breakpoint [gdb_get_line_number "Break at end."]
diff --git a/gdb/testsuite/gdb.python/py-symtab.exp b/gdb/testsuite/gdb.python/py-symtab.exp
index 786bdc75fc4..b5dd0c26988 100644
--- a/gdb/testsuite/gdb.python/py-symtab.exp
+++ b/gdb/testsuite/gdb.python/py-symtab.exp
@@ -27,7 +27,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
 }
 
 if {![runto_main]} {
-    return 0
+    return
 }
 
 set debug_types [debug_types]
diff --git a/gdb/testsuite/gdb.python/py-unwind-inline.exp b/gdb/testsuite/gdb.python/py-unwind-inline.exp
index ef9b00eccc8..d7d82913f61 100644
--- a/gdb/testsuite/gdb.python/py-unwind-inline.exp
+++ b/gdb/testsuite/gdb.python/py-unwind-inline.exp
@@ -29,7 +29,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
 
 # The following tests require execution.
 if {![runto_main]} {
-    return 0
+    return
 }
 
 set pyfile [gdb_remote_download host ${srcdir}/${subdir}/${testfile}.py]
diff --git a/gdb/testsuite/gdb.python/py-unwind-user-regs.exp b/gdb/testsuite/gdb.python/py-unwind-user-regs.exp
index c594bf74cee..248996c5161 100644
--- a/gdb/testsuite/gdb.python/py-unwind-user-regs.exp
+++ b/gdb/testsuite/gdb.python/py-unwind-user-regs.exp
@@ -47,7 +47,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
 }
 
 if {![runto_main]} {
-    return 0
+    return
 }
 
 set pyfile [gdb_remote_download host ${srcdir}/${subdir}/${testfile}.py]
diff --git a/gdb/testsuite/gdb.python/py-unwind.exp b/gdb/testsuite/gdb.python/py-unwind.exp
index 058caaf1efc..af864dceedf 100644
--- a/gdb/testsuite/gdb.python/py-unwind.exp
+++ b/gdb/testsuite/gdb.python/py-unwind.exp
@@ -37,7 +37,7 @@ require is_x86_64_m64_target
 # The following tests require execution.
 
 if {![runto_main]} {
-    return 0
+    return
 }
 
 # Check for the corrupt backtrace.
diff --git a/gdb/testsuite/gdb.python/py-value.exp b/gdb/testsuite/gdb.python/py-value.exp
index 3746a6cbc0b..4337928ddef 100644
--- a/gdb/testsuite/gdb.python/py-value.exp
+++ b/gdb/testsuite/gdb.python/py-value.exp
@@ -821,7 +821,7 @@ test_add_to_history
 # The following tests require execution.
 
 if {![runto_main]} {
-    return 0
+    return
 }
 
 test_unavailable
diff --git a/gdb/testsuite/gdb.python/python.exp b/gdb/testsuite/gdb.python/python.exp
index f2f32019e4c..7d3cd299bc8 100644
--- a/gdb/testsuite/gdb.python/python.exp
+++ b/gdb/testsuite/gdb.python/python.exp
@@ -210,7 +210,7 @@ clean_restart ${testfile}
 # The following tests require execution.
 
 if {![runto_main]} {
-    return 0
+    return
 }
 
 set lineno [gdb_get_line_number "Break to end."]
@@ -424,7 +424,7 @@ clean_restart ${testfile}
 # The following tests require execution.
 
 if {![runto_main]} {
-    return 0
+    return
 }
 
 # print-stack settings
@@ -479,7 +479,7 @@ clean_restart ${testfile}
 # The following tests require execution.
 
 if {![runto_main]} {
-    return 0
+    return
 }
 
 runto [gdb_get_line_number "Break at func2 call site."]
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.