From: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
To: gdb-patches@sourceware.org
Subject: [PATCH v2 11/37] GDB: testsuite: Don't return value from top-level in tests of various arches
Date: Wed, 29 Apr 2026 20:04:02 -0300 [thread overview]
Message-ID: <20260429230432.60487-12-thiago.bauermann@linaro.org> (raw)
In-Reply-To: <20260429230432.60487-1-thiago.bauermann@linaro.org>
This patch contains fixes for alpha, arc, avr, hppa and sh architectures.
Some changes are the result of running:
$ sed -i 's/^ return -1/ return/' *.exp
and
$ sed -i 's/^ return 0/ return/' *.exp
inside gdb/testsuite/gdb.arch and some are manual changes.
I didn't include changes made to return statements inside procedures.
---
gdb/testsuite/gdb.arch/alpha-step.exp | 2 +-
gdb/testsuite/gdb.arch/arc-analyze-prologue.exp | 4 ++--
gdb/testsuite/gdb.arch/arc-dbnz.exp | 4 ++--
gdb/testsuite/gdb.arch/arc-decode-insn.exp | 4 ++--
gdb/testsuite/gdb.arch/avr-flash-qualifier.exp | 10 +++++-----
gdb/testsuite/gdb.arch/gdb1291.exp | 4 ++--
gdb/testsuite/gdb.arch/gdb1431.exp | 4 ++--
gdb/testsuite/gdb.arch/gdb1558.exp | 2 +-
gdb/testsuite/gdb.arch/pa-nullify.exp | 8 ++++----
9 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/gdb/testsuite/gdb.arch/alpha-step.exp b/gdb/testsuite/gdb.arch/alpha-step.exp
index a15f86ea6567..d47b359c08d1 100644
--- a/gdb/testsuite/gdb.arch/alpha-step.exp
+++ b/gdb/testsuite/gdb.arch/alpha-step.exp
@@ -20,11 +20,11 @@ set testfile "alpha-step"
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {}] != "" } {
unsupported "failed to compile"
- return -1
+ return
}
clean_restart
gdb_load $binfile
diff --git a/gdb/testsuite/gdb.arch/arc-analyze-prologue.exp b/gdb/testsuite/gdb.arch/arc-analyze-prologue.exp
index 01699016dd67..693e5efe2260 100644
--- a/gdb/testsuite/gdb.arch/arc-analyze-prologue.exp
+++ b/gdb/testsuite/gdb.arch/arc-analyze-prologue.exp
@@ -24,15 +24,15 @@ standard_testfile .S
# debug information (which does not exist for .S code!) instead of analyzing
# frames manually.
set options {}
if { [prepare_for_testing "failed to prepare" $testfile $srcfile $options] } {
- return -1
+ return
}
if {![runto_main]} {
- return 0
+ return
}
# Convert list of saved registers and their offsets to a GDB string.
proc saved_regs_to_str { savedregs funcname } {
set str ""
diff --git a/gdb/testsuite/gdb.arch/arc-dbnz.exp b/gdb/testsuite/gdb.arch/arc-dbnz.exp
index ce93a6202933..2c091e45ecf1 100644
--- a/gdb/testsuite/gdb.arch/arc-dbnz.exp
+++ b/gdb/testsuite/gdb.arch/arc-dbnz.exp
@@ -32,15 +32,15 @@
require {istarget "arc*-*-*"}
standard_testfile .S
if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
- return -1
+ return
}
if {![runto_main]} {
- return 0
+ return
}
gdb_test "break dbnz1" \
"Breakpoint $decimal at .*" \
"set breakpoint on the 1st dbnz"
diff --git a/gdb/testsuite/gdb.arch/arc-decode-insn.exp b/gdb/testsuite/gdb.arch/arc-decode-insn.exp
index 0a7582d03a2a..4247c0215b82 100644
--- a/gdb/testsuite/gdb.arch/arc-decode-insn.exp
+++ b/gdb/testsuite/gdb.arch/arc-decode-insn.exp
@@ -34,15 +34,15 @@
require {istarget "arc*-*-*"}
standard_testfile .S
if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
- return -1
+ return
}
if {![runto_main]} {
- return 0
+ return
}
# Helper function that reads properties of instruction from the ELF file via
# its symbols and then confirms that decoder output aligns to the expected
# values.
diff --git a/gdb/testsuite/gdb.arch/avr-flash-qualifier.exp b/gdb/testsuite/gdb.arch/avr-flash-qualifier.exp
index a62e629f9209..e9a523a5d05a 100644
--- a/gdb/testsuite/gdb.arch/avr-flash-qualifier.exp
+++ b/gdb/testsuite/gdb.arch/avr-flash-qualifier.exp
@@ -20,22 +20,22 @@
require {istarget "avr*"}
# The __flash qualifier was added in GCC 4.7.
if {[test_compiler_info {gcc-[0-4]-[0-6]}]} {
- verbose "Skipping ${gdb_test_file_name}."
- return
+ verbose "Skipping ${gdb_test_file_name}."
+ return
}
standard_testfile
if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile}]} {
- return -1
+ return
}
if {![runto [gdb_get_line_number "break here."]]} {
- untested "could not run to \"break here.\""
- return -1
+ untested "could not run to \"break here.\""
+ return
}
gdb_test "print pointer_to_flash" \
" = $hex <data_in_flash> .*"
diff --git a/gdb/testsuite/gdb.arch/gdb1291.exp b/gdb/testsuite/gdb.arch/gdb1291.exp
index 82f9d52e08ba..ba4b88d75112 100644
--- a/gdb/testsuite/gdb.arch/gdb1291.exp
+++ b/gdb/testsuite/gdb.arch/gdb1291.exp
@@ -28,22 +28,22 @@ require {istarget "sh-*-*"}
set testfile "gdb1291"
set srcfile ${testfile}.s
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable ""] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart
gdb_load $binfile
#
# Run to `main' where we begin our tests.
#
if {![runto_main]} {
- return 0
+ return
}
gdb_test "b sub1" "Breakpoint 2.*" "set breakpoint"
gdb_test "c" "Breakpoint 2.* sub1 .*" "get to sub1"
diff --git a/gdb/testsuite/gdb.arch/gdb1431.exp b/gdb/testsuite/gdb.arch/gdb1431.exp
index 89952275d193..aedf66183186 100644
--- a/gdb/testsuite/gdb.arch/gdb1431.exp
+++ b/gdb/testsuite/gdb.arch/gdb1431.exp
@@ -30,22 +30,22 @@ require {istarget "sh-*-*"}
set testfile "gdb1431"
set srcfile ${testfile}.s
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable ""] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart
gdb_load $binfile
#
# Run to `main' where we begin our tests.
#
if {![runto_main]} {
- return 0
+ return
}
gdb_test "advance sub1" "hello world\r\n$hex in sub1 \\(\\)" "get to sub1"
gdb_test "advance sub2" "$hex in main \\(\\)" "advance returns from sub1 frame"
gdb_test "advance sub2" "$hex in sub2 \\(\\)" "get to sub2"
diff --git a/gdb/testsuite/gdb.arch/gdb1558.exp b/gdb/testsuite/gdb.arch/gdb1558.exp
index 5fbf86f5889a..7a3f44756452 100644
--- a/gdb/testsuite/gdb.arch/gdb1558.exp
+++ b/gdb/testsuite/gdb.arch/gdb1558.exp
@@ -27,11 +27,11 @@ set testfile "gdb1558"
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
# Note we have to compile WITH optimization and WITHOUT debugging information to expose the bug.
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {"additional_flags=-O2"}] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart
gdb_load $binfile
diff --git a/gdb/testsuite/gdb.arch/pa-nullify.exp b/gdb/testsuite/gdb.arch/pa-nullify.exp
index 1606d44afbf1..e527fe0955d8 100644
--- a/gdb/testsuite/gdb.arch/pa-nullify.exp
+++ b/gdb/testsuite/gdb.arch/pa-nullify.exp
@@ -35,11 +35,11 @@ set srcfile ${testfile}.s
set binfile ${objdir}/${subdir}/${testfile}
set gcorefile ${objdir}/${subdir}/${testfile}.gcore
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {}] != "" } {
unsupported "failed to compile"
- return -1
+ return
}
clean_restart
gdb_load $binfile
@@ -85,11 +85,11 @@ proc get_addr_of_sym { sym } {
return $addr
}
if {![runto_main]} {
- return 0
+ return
}
set foo [get_addr_of_sym "foo"]
set bar [get_addr_of_sym "bar"]
set foo_last "(bar - 4)"
@@ -121,21 +121,21 @@ proc test_core_bt { test } {
gdb_test "backtrace" ".*in foo.*in main.*" "$test: backtrace in gcore"
}
set test "core at last insn in foo"
if {![runto_main]} {
- return 0
+ return
}
gdb_breakpoint "*$foo_last"
gdb_test "continue" "Breakpoint \[0-9\]*,.* in foo.*" "$test: continue to breakpoint"
if {[gen_core $test]} {
test_core_bt $test
}
set test "core at nullified insn"
if {![runto_main]} {
- return 0
+ return
}
gdb_breakpoint "*$foo_last"
gdb_test "continue" "Breakpoint \[0-9\]*,.* in foo.*" "$test: continue to breakpoint"
gdb_test "stepi" ".*in foo.*" "$test: step to nullified instruction"
if {[gen_core $test]} {
next prev parent reply other threads:[~2026-04-29 23:06 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 ` Thiago Jung Bauermann [this message]
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 ` [PATCH v2 17/37] GDB: testsuite: C++: Don't return value from top-level (manual) Thiago Jung Bauermann
2026-04-29 23:04 ` [PATCH v2 18/37] GDB: testsuite: DWARF: Don't return value from top-level (sed) 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-12-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