From: Thiago Jung Bauermann Date: Wed, 29 Apr 2026 23:04:24 +0000 (-0300) Subject: GDB: testsuite: threads: Don't return 0 from top-level (sed) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=71d20ea30a2758630bcf19a4cb2e65053af77f7c;p=thirdparty%2Fbinutils-gdb.git GDB: testsuite: threads: Don't return 0 from top-level (sed) This patch is a bit different than the others. I noticed that gdb.threads has many cases of "return 0" from the top level, so this patch is purely the result of running: $ sed -i 's/^ return 0/ return/' *.exp* inside gdb/testsuite/gdb.threads. There were a number of false positives so not all sed changes were incorporated. Approved-By: Tom Tromey --- diff --git a/gdb/testsuite/gdb.threads/attach-many-short-lived-threads.exp b/gdb/testsuite/gdb.threads/attach-many-short-lived-threads.exp index 0f1b141b1ea..6f51e607d77 100644 --- a/gdb/testsuite/gdb.threads/attach-many-short-lived-threads.exp +++ b/gdb/testsuite/gdb.threads/attach-many-short-lived-threads.exp @@ -46,7 +46,7 @@ proc bad_dejagnu {} { if {[bad_dejagnu]} { unsupported "broken DejaGnu" - return 0 + return } require can_spawn_for_attach diff --git a/gdb/testsuite/gdb.threads/corethreads.exp b/gdb/testsuite/gdb.threads/corethreads.exp index 3749e3507bd..4e520c5e8f2 100644 --- a/gdb/testsuite/gdb.threads/corethreads.exp +++ b/gdb/testsuite/gdb.threads/corethreads.exp @@ -30,7 +30,7 @@ if { [gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executa set corefile [core_find $binfile] if {$corefile == ""} { untested "unable to create or find corefile" - return 0 + return } clean_restart $executable diff --git a/gdb/testsuite/gdb.threads/del-pending-thread-bp.exp b/gdb/testsuite/gdb.threads/del-pending-thread-bp.exp index 09a6f56a566..c318b38b472 100644 --- a/gdb/testsuite/gdb.threads/del-pending-thread-bp.exp +++ b/gdb/testsuite/gdb.threads/del-pending-thread-bp.exp @@ -45,7 +45,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile \ gdb_locate_shlib $binfile_lib if {![runto_main]} { - return 0 + return } # Run until we have two threads. diff --git a/gdb/testsuite/gdb.threads/dlopen-libpthread.exp b/gdb/testsuite/gdb.threads/dlopen-libpthread.exp index 03ce0dd1612..01f2186bcdc 100644 --- a/gdb/testsuite/gdb.threads/dlopen-libpthread.exp +++ b/gdb/testsuite/gdb.threads/dlopen-libpthread.exp @@ -15,7 +15,7 @@ require isnative allow_shlib_tests if {![istarget *-linux*]} { - return 0 + return } load_lib prelink-support.exp diff --git a/gdb/testsuite/gdb.threads/hand-call-in-threads.exp b/gdb/testsuite/gdb.threads/hand-call-in-threads.exp index f6d29720cc6..2f5eaa5405b 100644 --- a/gdb/testsuite/gdb.threads/hand-call-in-threads.exp +++ b/gdb/testsuite/gdb.threads/hand-call-in-threads.exp @@ -47,7 +47,7 @@ proc get_dummy_frame_number { } { clean_restart ${::testfile} if { ![runto_main] } { - return 0 + return } gdb_test "break all_threads_running" \ diff --git a/gdb/testsuite/gdb.threads/interrupted-hand-call.exp b/gdb/testsuite/gdb.threads/interrupted-hand-call.exp index 23a3d038c09..fe39b4ee903 100644 --- a/gdb/testsuite/gdb.threads/interrupted-hand-call.exp +++ b/gdb/testsuite/gdb.threads/interrupted-hand-call.exp @@ -31,7 +31,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab clean_restart ${::testfile} if { ![runto_main] } { - return 0 + return } gdb_test "break all_threads_running" \ diff --git a/gdb/testsuite/gdb.threads/next-while-other-thread-longjmps.exp b/gdb/testsuite/gdb.threads/next-while-other-thread-longjmps.exp index 6852e8d7f87..0647ff5cb76 100644 --- a/gdb/testsuite/gdb.threads/next-while-other-thread-longjmps.exp +++ b/gdb/testsuite/gdb.threads/next-while-other-thread-longjmps.exp @@ -28,7 +28,7 @@ if {[prepare_for_testing "failed to prepare" \ } if {![runto_main]} { - return 0 + return } gdb_breakpoint $linenum diff --git a/gdb/testsuite/gdb.threads/pending-step.exp b/gdb/testsuite/gdb.threads/pending-step.exp index c9ff1de32c8..a4fc5807167 100644 --- a/gdb/testsuite/gdb.threads/pending-step.exp +++ b/gdb/testsuite/gdb.threads/pending-step.exp @@ -57,7 +57,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab clean_restart ${::testfile} if {![runto_main]} { - return 0 + return } gdb_breakpoint [gdb_get_line_number "insert breakpoint here"] diff --git a/gdb/testsuite/gdb.threads/process-exit-status-is-leader-exit-status.exp b/gdb/testsuite/gdb.threads/process-exit-status-is-leader-exit-status.exp index 8ecacba59d5..80afd0e1f1a 100644 --- a/gdb/testsuite/gdb.threads/process-exit-status-is-leader-exit-status.exp +++ b/gdb/testsuite/gdb.threads/process-exit-status-is-leader-exit-status.exp @@ -26,7 +26,7 @@ # required to reproduce the error with a misbehaving GDB. if { ![istarget "*-*-linux*"] } { - return 0 + return } standard_testfile diff --git a/gdb/testsuite/gdb.threads/queue-signal.exp b/gdb/testsuite/gdb.threads/queue-signal.exp index 905f47c1243..aaa5bc91818 100644 --- a/gdb/testsuite/gdb.threads/queue-signal.exp +++ b/gdb/testsuite/gdb.threads/queue-signal.exp @@ -51,7 +51,7 @@ gdb_test_multiple "bt" "determine thread functions" { # No point in continuing if we couldn't figure out which thread is which. if { $sigusr1_thread == 0 } { # FAIL already recorded. - return 0 + return } # Advance each thread to where we want them one at a time. diff --git a/gdb/testsuite/gdb.threads/reconnect-signal.exp b/gdb/testsuite/gdb.threads/reconnect-signal.exp index e1079f3d1fe..f7a66ac844d 100644 --- a/gdb/testsuite/gdb.threads/reconnect-signal.exp +++ b/gdb/testsuite/gdb.threads/reconnect-signal.exp @@ -18,7 +18,7 @@ set gdbserver_reconnect_p 1 if { [info proc gdb_reconnect] == "" } { unsupported "requires gdbserver reconnect" - return 0 + return } standard_testfile @@ -35,7 +35,7 @@ if { [gdb_compile_pthreads \ clean_restart $executable if {![runto_main]} { - return 0 + return } gdb_test "continue" "signal SIGUSR1.*" "continue to signal" @@ -67,7 +67,7 @@ if { [lindex $res 0] == 0 } { pass $test } else { fail $test - return 0 + return } # Check that thread 2 is re-selected. diff --git a/gdb/testsuite/gdb.threads/stop-with-handle.exp b/gdb/testsuite/gdb.threads/stop-with-handle.exp index de40a3f1e94..be1d3860277 100644 --- a/gdb/testsuite/gdb.threads/stop-with-handle.exp +++ b/gdb/testsuite/gdb.threads/stop-with-handle.exp @@ -29,7 +29,7 @@ if {[prepare_for_testing "failed to prepare" \ } if {![runto_main]} { - return 0 + return } # Have SIGSTOP sent to the inferior. diff --git a/gdb/testsuite/gdb.threads/thread-unwindonsignal.exp b/gdb/testsuite/gdb.threads/thread-unwindonsignal.exp index d77b323338c..299d66b0516 100644 --- a/gdb/testsuite/gdb.threads/thread-unwindonsignal.exp +++ b/gdb/testsuite/gdb.threads/thread-unwindonsignal.exp @@ -31,7 +31,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab clean_restart ${::testfile} if { ![runto_main] } { - return 0 + return } gdb_test "break all_threads_running" \ diff --git a/gdb/testsuite/gdb.threads/threadapply.exp b/gdb/testsuite/gdb.threads/threadapply.exp index f8827ae7ea6..7fdc647705a 100644 --- a/gdb/testsuite/gdb.threads/threadapply.exp +++ b/gdb/testsuite/gdb.threads/threadapply.exp @@ -32,7 +32,7 @@ clean_restart ${::testfile} # if {![runto_main]} { - return 0 + return } # Break after all threads have been started. diff --git a/gdb/testsuite/gdb.threads/tls-nodebug-pie.exp b/gdb/testsuite/gdb.threads/tls-nodebug-pie.exp index 9d2a805c4a5..5e9c4ddd2e8 100644 --- a/gdb/testsuite/gdb.threads/tls-nodebug-pie.exp +++ b/gdb/testsuite/gdb.threads/tls-nodebug-pie.exp @@ -22,7 +22,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab clean_restart ${::testfile} if {![runto_main]} { - return 0 + return } # Formerly: Cannot access memory at address 0xffffef7c0698 diff --git a/gdb/testsuite/gdb.threads/tls-shared.exp b/gdb/testsuite/gdb.threads/tls-shared.exp index a293809105d..2710145c995 100644 --- a/gdb/testsuite/gdb.threads/tls-shared.exp +++ b/gdb/testsuite/gdb.threads/tls-shared.exp @@ -33,7 +33,7 @@ clean_restart ${::testfile} gdb_load_shlib ${binfile_lib} if {![runto_main]} { - return 0 + return } gdb_test "print i_tls" "2" "print thread local storage variable" diff --git a/gdb/testsuite/gdb.threads/tls-so_extern.exp b/gdb/testsuite/gdb.threads/tls-so_extern.exp index eb3f32df621..f1c0b66ad93 100644 --- a/gdb/testsuite/gdb.threads/tls-so_extern.exp +++ b/gdb/testsuite/gdb.threads/tls-so_extern.exp @@ -32,7 +32,7 @@ clean_restart ${::testfile} gdb_load_shlib ${binfile_lib} if {![runto_main]} { - return 0 + return } gdb_test "print so_extern" "0x0" "print thread local storage variable" diff --git a/gdb/testsuite/gdb.threads/tls-var.exp b/gdb/testsuite/gdb.threads/tls-var.exp index 5b2968a7bd0..28d0886c6bf 100644 --- a/gdb/testsuite/gdb.threads/tls-var.exp +++ b/gdb/testsuite/gdb.threads/tls-var.exp @@ -28,7 +28,7 @@ if { [gdb_compile ${srcdir}/${subdir}/${srcfile} ${objfile} object {debug}] != " clean_restart ${executable} if {![runto_main]} { - return 0 + return } # FAIL was: type = diff --git a/gdb/testsuite/gdb.threads/watchthreads-reorder.exp b/gdb/testsuite/gdb.threads/watchthreads-reorder.exp index 58b16be70f2..f56661d7a5c 100644 --- a/gdb/testsuite/gdb.threads/watchthreads-reorder.exp +++ b/gdb/testsuite/gdb.threads/watchthreads-reorder.exp @@ -27,7 +27,7 @@ require allow_hw_watchpoint_access_tests allow_hw_watchpoint_multi_tests if {![istarget *-*-linux*]} { - return 0 + return } standard_testfile diff --git a/gdb/testsuite/gdb.threads/watchthreads.exp b/gdb/testsuite/gdb.threads/watchthreads.exp index e975e22e573..2682db7b032 100644 --- a/gdb/testsuite/gdb.threads/watchthreads.exp +++ b/gdb/testsuite/gdb.threads/watchthreads.exp @@ -39,7 +39,7 @@ gdb_test_no_output "set can-use-hw-watchpoints 1" "" # if {![runto_main]} { - return 0 + return } set args_0 0 diff --git a/gdb/testsuite/gdb.threads/watchthreads2.exp b/gdb/testsuite/gdb.threads/watchthreads2.exp index 49884f4136d..0efef51b7fc 100644 --- a/gdb/testsuite/gdb.threads/watchthreads2.exp +++ b/gdb/testsuite/gdb.threads/watchthreads2.exp @@ -40,7 +40,7 @@ gdb_test_no_output "set can-use-hw-watchpoints 1" "" # if {![runto_main]} { - return 0 + return } gdb_test "break thread_started" \ diff --git a/gdb/testsuite/gdb.threads/wp-replication.exp b/gdb/testsuite/gdb.threads/wp-replication.exp index 28a5071bd5e..cc9bc50f9b2 100644 --- a/gdb/testsuite/gdb.threads/wp-replication.exp +++ b/gdb/testsuite/gdb.threads/wp-replication.exp @@ -41,7 +41,7 @@ gdb_test_no_output "set can-use-hw-watchpoints 1" "" # Run to `main' where we begin our tests. if {![runto_main]} { - return 0 + return } # Set some default values.