From: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
To: gdb-patches@sourceware.org
Subject: [PATCH 32/36] GDB: testsuite: threads: Don't return 0 from top-level (sed)
Date: Mon, 27 Apr 2026 03:34:56 -0300 [thread overview]
Message-ID: <20260427063500.3847618-33-thiago.bauermann@linaro.org> (raw)
In-Reply-To: <20260427063500.3847618-1-thiago.bauermann@linaro.org>
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.
---
.../gdb.threads/attach-many-short-lived-threads.exp | 2 +-
gdb/testsuite/gdb.threads/corethreads.exp | 2 +-
gdb/testsuite/gdb.threads/del-pending-thread-bp.exp | 2 +-
gdb/testsuite/gdb.threads/dlopen-libpthread.exp | 2 +-
gdb/testsuite/gdb.threads/hand-call-in-threads.exp | 2 +-
gdb/testsuite/gdb.threads/interrupted-hand-call.exp | 2 +-
.../gdb.threads/next-while-other-thread-longjmps.exp | 2 +-
gdb/testsuite/gdb.threads/pending-step.exp | 2 +-
.../process-exit-status-is-leader-exit-status.exp | 2 +-
gdb/testsuite/gdb.threads/queue-signal.exp | 2 +-
gdb/testsuite/gdb.threads/reconnect-signal.exp | 6 +++---
gdb/testsuite/gdb.threads/stop-with-handle.exp | 2 +-
gdb/testsuite/gdb.threads/thread-unwindonsignal.exp | 2 +-
gdb/testsuite/gdb.threads/threadapply.exp | 2 +-
gdb/testsuite/gdb.threads/tls-nodebug-pie.exp | 2 +-
gdb/testsuite/gdb.threads/tls-shared.exp | 2 +-
gdb/testsuite/gdb.threads/tls-so_extern.exp | 2 +-
gdb/testsuite/gdb.threads/tls-var.exp | 2 +-
gdb/testsuite/gdb.threads/watchthreads-reorder.exp | 2 +-
gdb/testsuite/gdb.threads/watchthreads.exp | 2 +-
gdb/testsuite/gdb.threads/watchthreads2.exp | 2 +-
gdb/testsuite/gdb.threads/wp-replication.exp | 2 +-
22 files changed, 24 insertions(+), 24 deletions(-)
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 0f1b141b1ea1..6f51e607d77d 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 3749e3507bdc..4e520c5e8f22 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 09a6f56a5660..c318b38b472a 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 03ce0dd1612d..01f2186bcdc8 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 f6d29720cc6f..2f5eaa5405bf 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 23a3d038c09a..fe39b4ee9035 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 6852e8d7f876..0647ff5cb760 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 c9ff1de32c89..a4fc5807167c 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 8ecacba59d5e..80afd0e1f1a2 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 905f47c1243b..aaa5bc91818a 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 e1079f3d1feb..f7a66ac844db 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 de40a3f1e946..be1d38602778 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 d77b323338cc..299d66b0516d 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 f8827ae7ea65..7fdc647705a9 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 9d2a805c4a5f..5e9c4ddd2e8b 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 a293809105d6..2710145c9958 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 eb3f32df6210..f1c0b66ad935 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 5b2968a7bd01..28d0886c6bfd 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 = <thread local variable, no debug info>
diff --git a/gdb/testsuite/gdb.threads/watchthreads-reorder.exp b/gdb/testsuite/gdb.threads/watchthreads-reorder.exp
index 58b16be70f26..f56661d7a5c2 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 e975e22e5730..2682db7b0328 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 49884f4136dd..0efef51b7fc6 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 28a5071bd5e5..cc9bc50f9b2e 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.
next prev parent reply other threads:[~2026-04-27 6:40 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-27 6:34 [PATCH 00/36] GDB: testsuite: Fix top-level returns Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 01/36] GDB: testsuite: aarch64, arm: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 02/36] GDB: testsuite: aarch64, arm: Don't return -1 from top-level (manual) Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 03/36] GDB: testsuite: intel: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-28 15:54 ` Schimpe, Christina
2026-04-28 16:42 ` Schimpe, Christina
2026-04-27 6:34 ` [PATCH 04/36] GDB: testsuite: intel: Don't return -1 from top-level (manual) Thiago Jung Bauermann
2026-04-28 16:39 ` Schimpe, Christina
2026-04-28 21:48 ` Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 05/36] GDB: testsuite: powerpc: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 06/36] GDB: testsuite: powerpc: Don't return -1 from top-level (manual) Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 07/36] GDB: testsuite: riscv: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 08/36] GDB: testsuite: riscv: Don't return -1 from top-level (manual) Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 09/36] GDB: testsuite: s390: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 10/36] GDB: testsuite: sparc: " Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 11/36] GDB: testsuite: Don't return -1 from top-level in tests of various arches Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 12/36] GDB: testsuite: Don't return -1 from top-level in multi-arch tests Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 13/36] GDB: testsuite: base: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 14/36] GDB: testsuite: base: Don't return 0 " Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 15/36] GDB: testsuite: base: Don't return -1 from top-level (manual) Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 16/36] GDB: testsuite: C++: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 17/36] GDB: testsuite: C++: Don't return -1 from top-level (manual) Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 18/36] GDB: testsuite: DWARF: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 19/36] GDB: testsuite: DWARF: Don't return -1 from top-level (manual) Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 20/36] GDB: testsuite: GDB: Don't return -1 from top-level Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 21/36] GDB: testsuite: Guile: " Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 22/36] GDB: testsuite: Python: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 23/36] GDB: testsuite: Python: Don't return -1 from top-level (manual) Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 24/36] GDB: testsuite: linespec: Don't return -1 from top-level Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 25/36] GDB: testsuite: MI: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 26/36] GDB: testsuite: MI: Don't return -1 from top-level (manual) Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 27/36] GDB: testsuite: reverse: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 28/36] GDB: testsuite: reverse: Don't return -1 from top-level (manual) Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 29/36] GDB: testsuite: server: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 30/36] GDB: testsuite: server: Don't return -1 from top-level (manual) Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 31/36] GDB: testsuite: threads: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-27 6:34 ` Thiago Jung Bauermann [this message]
2026-04-27 6:34 ` [PATCH 33/36] GDB: testsuite: threads: Don't return -1 from top-level (manual) Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 34/36] GDB: testsuite: TUI: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 35/36] GDB: testsuite: TUI: Don't return 0 from top-level (manual) Thiago Jung Bauermann
2026-04-27 6:35 ` [PATCH 36/36] GDB: testsuite: XML: Don't return -1 nor 0 from top-level 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=20260427063500.3847618-33-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