From: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
To: gdb-patches@sourceware.org
Subject: [PATCH v2 17/37] GDB: testsuite: C++: Don't return value from top-level (manual)
Date: Wed, 29 Apr 2026 20:04:08 -0300 [thread overview]
Message-ID: <20260429230432.60487-18-thiago.bauermann@linaro.org> (raw)
In-Reply-To: <20260429230432.60487-1-thiago.bauermann@linaro.org>
This patch manually changes "return -1" and "return 0" statements that
weren't caught by the sed command.
These return statements fall into one of these criteria:
- misaligned line, which is then fixed by this patch;
- return at top level but inside block such as save_vars,
with_test_prefix, foreach, gdb_test_multiple.
Some weren't changed because they didn't meet the criteria above, or
weren't trivial to check.
---
gdb/testsuite/gdb.cp/anon-struct.exp | 2 +-
gdb/testsuite/gdb.cp/converts.exp | 2 +-
gdb/testsuite/gdb.cp/cp-relocate.exp | 8 ++++----
gdb/testsuite/gdb.cp/cpsizeof.exp | 2 +-
gdb/testsuite/gdb.cp/expand-psymtabs-cxx.exp | 4 ++--
gdb/testsuite/gdb.cp/fpointer.exp | 2 +-
gdb/testsuite/gdb.cp/koenig.exp | 2 +-
gdb/testsuite/gdb.cp/method2.exp | 2 +-
gdb/testsuite/gdb.cp/nsnested.exp | 2 +-
gdb/testsuite/gdb.cp/nsnoimports.exp | 2 +-
gdb/testsuite/gdb.cp/oranking.exp | 2 +-
gdb/testsuite/gdb.cp/pr10728.exp | 12 ++++++------
gdb/testsuite/gdb.cp/rvalue-ref-sizeof.exp | 2 +-
gdb/testsuite/gdb.cp/save-bp-qualified.exp | 4 ++--
gdb/testsuite/gdb.cp/smartp.exp | 2 +-
gdb/testsuite/gdb.cp/static-print-quit.exp | 2 +-
16 files changed, 26 insertions(+), 26 deletions(-)
diff --git a/gdb/testsuite/gdb.cp/anon-struct.exp b/gdb/testsuite/gdb.cp/anon-struct.exp
index e420d75207fd..10b7ce6c7766 100644
--- a/gdb/testsuite/gdb.cp/anon-struct.exp
+++ b/gdb/testsuite/gdb.cp/anon-struct.exp
@@ -18,11 +18,11 @@
# for types and functions within anonymous structures.
standard_testfile .cc
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++}] } {
- return -1
+ return
}
# Clang doesn't add any names for functions within anonymous structures,
# so there is no way to try and refer to them inside GDB.
if {[test_compiler_info clang-*-* c++]} {
diff --git a/gdb/testsuite/gdb.cp/converts.exp b/gdb/testsuite/gdb.cp/converts.exp
index 7d26db9f3022..60a732f87ee0 100644
--- a/gdb/testsuite/gdb.cp/converts.exp
+++ b/gdb/testsuite/gdb.cp/converts.exp
@@ -14,11 +14,11 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
standard_testfile .cc
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++}] } {
- return -1
+ return
}
############################################
if {![runto_main]} {
diff --git a/gdb/testsuite/gdb.cp/cp-relocate.exp b/gdb/testsuite/gdb.cp/cp-relocate.exp
index c42c67a95e75..67a9f21b9646 100644
--- a/gdb/testsuite/gdb.cp/cp-relocate.exp
+++ b/gdb/testsuite/gdb.cp/cp-relocate.exp
@@ -19,12 +19,12 @@ standard_testfile .cc
append binfile .o
require allow_cplus_tests
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {c++ debug}] != "" } {
- untested "failed to compile"
- return -1
+ untested "failed to compile"
+ return
}
proc get_func_address { func } {
global gdb_prompt hex
@@ -65,11 +65,11 @@ gdb_test_multiple "info functions func<.>" "info functions" {
-re "$gdb_prompt $" {
if { ${func1_name} != "" && ${func2_name} != "" } {
pass "info functions"
} else {
fail "info functions"
- return -1
+ return
}
}
}
# Check that all the functions have different addresses.
@@ -103,11 +103,11 @@ gdb_test_multiple "info file" "info file" {
-re "$gdb_prompt $" {
if { ${func1_sec} != "" && ${func2_sec} != "" } {
pass "info file"
} else {
fail "info file"
- return -1
+ return
}
}
}
if { $func1_sec == $func2_sec } {
diff --git a/gdb/testsuite/gdb.cp/cpsizeof.exp b/gdb/testsuite/gdb.cp/cpsizeof.exp
index a43ae6431acf..239811855791 100644
--- a/gdb/testsuite/gdb.cp/cpsizeof.exp
+++ b/gdb/testsuite/gdb.cp/cpsizeof.exp
@@ -17,11 +17,11 @@
standard_testfile .cc
require allow_cplus_tests
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}] } {
- return -1
+ return
}
if {![runto_main]} {
perror "could not run to main"
return
diff --git a/gdb/testsuite/gdb.cp/expand-psymtabs-cxx.exp b/gdb/testsuite/gdb.cp/expand-psymtabs-cxx.exp
index 110970c89b8b..e0d34c86a11d 100644
--- a/gdb/testsuite/gdb.cp/expand-psymtabs-cxx.exp
+++ b/gdb/testsuite/gdb.cp/expand-psymtabs-cxx.exp
@@ -17,12 +17,12 @@
standard_testfile .cc
set executable ${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {debug c++} ] != "" } {
- untested "failed to compile"
- return -1
+ untested "failed to compile"
+ return
}
clean_restart ${executable}
gdb_test_no_output "set language c++"
diff --git a/gdb/testsuite/gdb.cp/fpointer.exp b/gdb/testsuite/gdb.cp/fpointer.exp
index a97eef7e55b6..f4f69a0532d6 100644
--- a/gdb/testsuite/gdb.cp/fpointer.exp
+++ b/gdb/testsuite/gdb.cp/fpointer.exp
@@ -17,11 +17,11 @@
# complex expressions.
standard_testfile .cc
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++}] } {
- return -1
+ return
}
if {![runto_main]} {
return
}
diff --git a/gdb/testsuite/gdb.cp/koenig.exp b/gdb/testsuite/gdb.cp/koenig.exp
index 474c4a95b41e..4fd755ad7b7c 100644
--- a/gdb/testsuite/gdb.cp/koenig.exp
+++ b/gdb/testsuite/gdb.cp/koenig.exp
@@ -20,11 +20,11 @@ lappend opts debug
lappend opts c++
lappend opts additional_flags=-Wno-unused-comparison
lappend opts additional_flags=-std=c++11
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} $opts] } {
- return -1
+ return
}
############################################
if {![runto_main]} {
diff --git a/gdb/testsuite/gdb.cp/method2.exp b/gdb/testsuite/gdb.cp/method2.exp
index 4eed2197c36c..e64853ab7ae8 100644
--- a/gdb/testsuite/gdb.cp/method2.exp
+++ b/gdb/testsuite/gdb.cp/method2.exp
@@ -21,11 +21,11 @@
require allow_cplus_tests
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
if {![runto_main]} {
return
}
diff --git a/gdb/testsuite/gdb.cp/nsnested.exp b/gdb/testsuite/gdb.cp/nsnested.exp
index 8c1cef585a8d..11b326fa9b9c 100644
--- a/gdb/testsuite/gdb.cp/nsnested.exp
+++ b/gdb/testsuite/gdb.cp/nsnested.exp
@@ -14,11 +14,11 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
standard_testfile .cc
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++}] } {
- return -1
+ return
}
############################################
if {![runto_main]} {
return
diff --git a/gdb/testsuite/gdb.cp/nsnoimports.exp b/gdb/testsuite/gdb.cp/nsnoimports.exp
index 3077e447c285..7c9e70ac3bf1 100644
--- a/gdb/testsuite/gdb.cp/nsnoimports.exp
+++ b/gdb/testsuite/gdb.cp/nsnoimports.exp
@@ -14,11 +14,11 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
standard_testfile .cc
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++}] } {
- return -1
+ return
}
############################################
if {![runto_main]} {
return
diff --git a/gdb/testsuite/gdb.cp/oranking.exp b/gdb/testsuite/gdb.cp/oranking.exp
index f7a2f4636227..1f418a96a7db 100644
--- a/gdb/testsuite/gdb.cp/oranking.exp
+++ b/gdb/testsuite/gdb.cp/oranking.exp
@@ -14,11 +14,11 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
standard_testfile .cc
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++}] } {
- return -1
+ return
}
############################################
if {![runto_main]} {
diff --git a/gdb/testsuite/gdb.cp/pr10728.exp b/gdb/testsuite/gdb.cp/pr10728.exp
index 0625d243bd8f..2560325ae727 100644
--- a/gdb/testsuite/gdb.cp/pr10728.exp
+++ b/gdb/testsuite/gdb.cp/pr10728.exp
@@ -26,22 +26,22 @@ include_file pr10728-x.h
set tfx [standard_output_file pr10728-x.o]
set tfy [standard_output_file pr10728-y.o]
if { [gdb_compile "${srcdir}/${subdir}/$srcfile2" "${tfy}.o" object {c++}] != "" } {
- untested "failed to compile second object file"
- return -1
+ untested "failed to compile second object file"
+ return
}
if { [gdb_compile "${srcdir}/${subdir}/$srcfile" "${tfx}.o" object {debug c++}] != "" } {
- untested "failed to compile first object file"
- return -1
+ untested "failed to compile first object file"
+ return
}
if { [gdb_compile "${tfx}.o ${tfy}.o" ${binfile} executable {debug c++}] != "" } {
- untested "failed to compile"
- return -1
+ untested "failed to compile"
+ return
}
clean_restart $::testfile
if {![runto_main]} {
diff --git a/gdb/testsuite/gdb.cp/rvalue-ref-sizeof.exp b/gdb/testsuite/gdb.cp/rvalue-ref-sizeof.exp
index a21485e215cb..ed15018b37ff 100644
--- a/gdb/testsuite/gdb.cp/rvalue-ref-sizeof.exp
+++ b/gdb/testsuite/gdb.cp/rvalue-ref-sizeof.exp
@@ -20,11 +20,11 @@ standard_testfile .cc
require allow_cplus_tests
if {[prepare_for_testing ${testfile}.exp $testfile $srcfile \
{debug c++ additional_flags="-std=gnu++11"}] } {
- return -1
+ return
}
if {![runto_main]} {
perror "could not run to main"
return
diff --git a/gdb/testsuite/gdb.cp/save-bp-qualified.exp b/gdb/testsuite/gdb.cp/save-bp-qualified.exp
index a6851ba96623..345290276628 100644
--- a/gdb/testsuite/gdb.cp/save-bp-qualified.exp
+++ b/gdb/testsuite/gdb.cp/save-bp-qualified.exp
@@ -36,11 +36,11 @@ proc restart {} {
return 1
}
with_test_prefix "save" {
if {![restart]} {
- return -1
+ return
}
gdb_breakpoint "function" qualified
gdb_breakpoint "function"
@@ -54,11 +54,11 @@ with_test_prefix "save" {
gdb_test "save breakpoint $bps" "" "save breakpoint bps"
}
with_test_prefix "restore" {
if {![restart]} {
- return -1
+ return
}
# Restore the breakpoints.
gdb_test "source $bps" "" "source bps"
diff --git a/gdb/testsuite/gdb.cp/smartp.exp b/gdb/testsuite/gdb.cp/smartp.exp
index 8a79f4385a9c..4c04a465e475 100644
--- a/gdb/testsuite/gdb.cp/smartp.exp
+++ b/gdb/testsuite/gdb.cp/smartp.exp
@@ -14,11 +14,11 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
standard_testfile .cc
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++}] } {
- return -1
+ return
}
############################################
if {![runto_main]} {
diff --git a/gdb/testsuite/gdb.cp/static-print-quit.exp b/gdb/testsuite/gdb.cp/static-print-quit.exp
index 19756f64732e..58f4f5283b30 100644
--- a/gdb/testsuite/gdb.cp/static-print-quit.exp
+++ b/gdb/testsuite/gdb.cp/static-print-quit.exp
@@ -32,11 +32,11 @@ gdb_test_multiple "print c" "" {
pass $gdb_test_name
}
-re "\r\n$pagination_prompt$" {
# gdb-7.1 did not crash with this testcase but it had the same bug.
untested "bug does not reproduce"
- return 0
+ return
}
}
gdb_test "q" ".*"
next prev parent reply other threads:[~2026-04-29 23:07 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-29 23:03 [PATCH v2 00/37] GDB: testsuite: Fix top-level returns Thiago Jung Bauermann
2026-04-29 23:03 ` [PATCH v2 01/37] GDB: testsuite: aarch64, arm: Don't return value from top-level (sed) Thiago Jung Bauermann
2026-04-29 23:03 ` [PATCH v2 02/37] GDB: testsuite: aarch64, arm: Don't return value from top-level (manual) Thiago Jung Bauermann
2026-04-29 23:03 ` [PATCH v2 03/37] GDB: testsuite: x86, amd64, i386, ia64: Don't return value from top-level (sed) Thiago Jung Bauermann
2026-04-29 23:03 ` [PATCH v2 04/37] GDB: testsuite: x86, amd64, i386: Don't return value from top-level (manual) Thiago Jung Bauermann
2026-04-29 23:03 ` [PATCH v2 05/37] GDB: testsuite: powerpc: Don't return value from top-level (sed) Thiago Jung Bauermann
2026-04-29 23:03 ` [PATCH v2 06/37] GDB: testsuite: powerpc: Don't return value from top-level (manual) Thiago Jung Bauermann
2026-04-29 23:03 ` [PATCH v2 07/37] GDB: testsuite: riscv: Don't return value from top-level (sed) Thiago Jung Bauermann
2026-04-29 23:03 ` [PATCH v2 08/37] GDB: testsuite: riscv: Don't return value from top-level (manual) Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 09/37] GDB: testsuite: s390: Don't return value from top-level (sed) Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 10/37] GDB: testsuite: sparc: " Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 11/37] GDB: testsuite: Don't return value from top-level in tests of various arches Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 12/37] GDB: testsuite: Don't return value from top-level in multi-arch tests Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 13/37] GDB: testsuite: base: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 14/37] GDB: testsuite: base: Don't return 0 " Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 15/37] GDB: testsuite: base: Don't return value from top-level (manual) Thiago Jung Bauermann
2026-05-08 22:01 ` Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 16/37] GDB: testsuite: C++: Don't return value from top-level (sed) Thiago Jung Bauermann
2026-04-29 23:04 ` Thiago Jung Bauermann [this message]
2026-04-29 23:04 ` [PATCH v2 18/37] GDB: testsuite: DWARF: " Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 19/37] GDB: testsuite: DWARF: Don't return -1 from top-level (manual) Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 20/37] GDB: testsuite: GDB: Don't return -1 from top-level Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 21/37] GDB: testsuite: Guile: " Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 22/37] GDB: testsuite: Python: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 23/37] GDB: testsuite: Python: Don't return 0 " Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 24/37] GDB: testsuite: Python: Don't return value from top-level (manual) Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 25/37] GDB: testsuite: linespec: Don't return value from top-level Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 26/37] GDB: testsuite: MI: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 27/37] GDB: testsuite: MI: Don't return value from top-level (manual) Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 28/37] GDB: testsuite: reverse: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 29/37] GDB: testsuite: reverse: Don't return value from top-level (manual) Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 30/37] GDB: testsuite: server: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 31/37] GDB: testsuite: server: Don't return value from top-level (manual) Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 32/37] GDB: testsuite: threads: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 33/37] GDB: testsuite: threads: Don't return 0 " Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 34/37] GDB: testsuite: threads: Don't return value from top-level (manual) Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 35/37] GDB: testsuite: TUI: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 36/37] GDB: testsuite: TUI: Don't return 0 from top-level (manual) Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 37/37] GDB: testsuite: XML: Don't return -1 nor 0 from top-level Thiago Jung Bauermann
2026-05-08 17:47 ` [PATCH v2 00/37] GDB: testsuite: Fix top-level returns Tom Tromey
2026-05-08 22:06 ` 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=20260429230432.60487-18-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