From: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
To: gdb-patches@sourceware.org
Subject: [PATCH 24/36] GDB: testsuite: linespec: Don't return -1 from top-level
Date: Mon, 27 Apr 2026 03:34:48 -0300 [thread overview]
Message-ID: <20260427063500.3847618-25-thiago.bauermann@linaro.org> (raw)
In-Reply-To: <20260427063500.3847618-1-thiago.bauermann@linaro.org>
Most changes are the result of running:
$ sed -i 's/^ return -1/ return/' *.exp
inside gdb/testsuite/gdb.linespec. The exceptions fall into one of
these criteria:
- misaligned line, which is then fixed by this patch;
- return at top level but inside a namespace block;
- procedure whose callers don't use the return value.
---
gdb/testsuite/gdb.linespec/break-ask.exp | 2 +-
gdb/testsuite/gdb.linespec/break-asm-file.exp | 8 ++++----
gdb/testsuite/gdb.linespec/cp-completion-aliases.exp | 2 +-
.../gdb.linespec/cp-replace-typedefs-ns-template.exp | 2 +-
gdb/testsuite/gdb.linespec/cpcompletion.exp | 4 ++--
gdb/testsuite/gdb.linespec/cpexplicit.exp | 4 ++--
gdb/testsuite/gdb.linespec/cpls-abi-tag.exp | 4 ++--
gdb/testsuite/gdb.linespec/cpls-ops.exp | 4 ++--
gdb/testsuite/gdb.linespec/errors.exp | 2 +-
gdb/testsuite/gdb.linespec/explicit.exp | 4 ++--
gdb/testsuite/gdb.linespec/keywords.exp | 4 ++--
gdb/testsuite/gdb.linespec/linespec.exp | 2 +-
gdb/testsuite/gdb.linespec/ls-dollar.exp | 2 +-
gdb/testsuite/gdb.linespec/ls-errs.exp | 6 +++---
gdb/testsuite/gdb.linespec/macro-relative.exp | 2 +-
gdb/testsuite/gdb.linespec/skip-two.exp | 6 +++---
gdb/testsuite/gdb.linespec/thread.exp | 4 ++--
17 files changed, 31 insertions(+), 31 deletions(-)
diff --git a/gdb/testsuite/gdb.linespec/break-ask.exp b/gdb/testsuite/gdb.linespec/break-ask.exp
index ed91d7defb15..90d5044765e4 100644
--- a/gdb/testsuite/gdb.linespec/break-ask.exp
+++ b/gdb/testsuite/gdb.linespec/break-ask.exp
@@ -42,7 +42,7 @@ with_cwd $srcdir/${subdir}/base/two {
if { [gdb_compile "$srcdir/${subdir}/$srcfile $objfile1 $objfile2" \
$binfile executable $opts] != "" } {
- return -1
+ return
}
clean_restart ${testfile}
diff --git a/gdb/testsuite/gdb.linespec/break-asm-file.exp b/gdb/testsuite/gdb.linespec/break-asm-file.exp
index b8dadc15c4ca..c6ae8dea7be9 100644
--- a/gdb/testsuite/gdb.linespec/break-asm-file.exp
+++ b/gdb/testsuite/gdb.linespec/break-asm-file.exp
@@ -28,22 +28,22 @@ require dwarf2_support
if {[gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile}1.o \
object {debug nowarnings optimize=-O0}] != ""} {
- return -1
+ return
}
# Compile .s files without debug information.
if {[gdb_compile ${srcdir}/${subdir}/$asm_file0 ${binfile}2.o \
object {nodebug}] != ""} {
- return -1
+ return
}
if {[gdb_compile ${srcdir}/${subdir}/$asm_file1 ${binfile}3.o \
object {nodebug}] != ""} {
- return -1
+ return
}
if {[gdb_compile [list ${binfile}1.o ${binfile}2.o ${binfile}3.o] \
"${binfile}" executable {}] != ""} {
- return -1
+ return
}
clean_restart $execfile
diff --git a/gdb/testsuite/gdb.linespec/cp-completion-aliases.exp b/gdb/testsuite/gdb.linespec/cp-completion-aliases.exp
index fe7ae40c9a22..a3f99998840f 100644
--- a/gdb/testsuite/gdb.linespec/cp-completion-aliases.exp
+++ b/gdb/testsuite/gdb.linespec/cp-completion-aliases.exp
@@ -21,7 +21,7 @@ load_lib completion-support.exp
standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
- return -1
+ return
}
# Disable the completion limit for the whole testcase.
diff --git a/gdb/testsuite/gdb.linespec/cp-replace-typedefs-ns-template.exp b/gdb/testsuite/gdb.linespec/cp-replace-typedefs-ns-template.exp
index b12f14da1543..c82410e29325 100644
--- a/gdb/testsuite/gdb.linespec/cp-replace-typedefs-ns-template.exp
+++ b/gdb/testsuite/gdb.linespec/cp-replace-typedefs-ns-template.exp
@@ -23,7 +23,7 @@ standard_testfile .cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
{debug c++ additional_flags=-std=c++11}]} {
- return -1
+ return
}
# Disable the completion limit for the whole testcase.
diff --git a/gdb/testsuite/gdb.linespec/cpcompletion.exp b/gdb/testsuite/gdb.linespec/cpcompletion.exp
index 14eb1a68c81a..96c7a968ed6c 100644
--- a/gdb/testsuite/gdb.linespec/cpcompletion.exp
+++ b/gdb/testsuite/gdb.linespec/cpcompletion.exp
@@ -30,7 +30,7 @@ lappend flags debug
if {[prepare_for_testing "failed to prepare" $testfile \
[list $srcfile $srcfile2 $srcfile3 $srcfile4] $opts]} {
- return -1
+ return
}
# Tests below are about tab-completion, which doesn't work if readline
@@ -38,7 +38,7 @@ if {[prepare_for_testing "failed to prepare" $testfile \
if { ![readline_is_used] } {
untested "no tab completion support without readline"
- return -1
+ return
}
#
diff --git a/gdb/testsuite/gdb.linespec/cpexplicit.exp b/gdb/testsuite/gdb.linespec/cpexplicit.exp
index b5dbc6dceece..8c9de2aa8991 100644
--- a/gdb/testsuite/gdb.linespec/cpexplicit.exp
+++ b/gdb/testsuite/gdb.linespec/cpexplicit.exp
@@ -22,7 +22,7 @@ set exefile $testfile
if {[prepare_for_testing "failed to prepare" $exefile $srcfile \
{c++ debug nowarnings}]} {
- return -1
+ return
}
# Wrap this whole test in a namespace to avoid contaminating other tests.
@@ -90,7 +90,7 @@ namespace eval $testfile {
# Fire up gdb.
if {![runto_main]} {
namespace delete $testfile
- return -1
+ return
}
# Test explicit linespecs, with and without conditions.
diff --git a/gdb/testsuite/gdb.linespec/cpls-abi-tag.exp b/gdb/testsuite/gdb.linespec/cpls-abi-tag.exp
index 6399f252d71d..80c8a3937e11 100644
--- a/gdb/testsuite/gdb.linespec/cpls-abi-tag.exp
+++ b/gdb/testsuite/gdb.linespec/cpls-abi-tag.exp
@@ -31,7 +31,7 @@ if { [test_compiler_info gcc-*] } {
if {[prepare_for_testing "failed to prepare" $testfile \
[list $srcfile] {c++ debug}]} {
- return -1
+ return
}
# Tests below are about tab-completion, which doesn't work if readline
@@ -39,7 +39,7 @@ if {[prepare_for_testing "failed to prepare" $testfile \
if { ![readline_is_used] } {
untested "no tab completion support without readline"
- return -1
+ return
}
gdb_test_no_output "set max-completions unlimited"
diff --git a/gdb/testsuite/gdb.linespec/cpls-ops.exp b/gdb/testsuite/gdb.linespec/cpls-ops.exp
index 4cef26e6767e..c49afaa9856c 100644
--- a/gdb/testsuite/gdb.linespec/cpls-ops.exp
+++ b/gdb/testsuite/gdb.linespec/cpls-ops.exp
@@ -25,7 +25,7 @@ lappend flags c++
if {[prepare_for_testing "failed to prepare" $testfile \
[list $srcfile] $flags]} {
- return -1
+ return
}
# Tests below are about tab-completion, which doesn't work if readline
@@ -33,7 +33,7 @@ if {[prepare_for_testing "failed to prepare" $testfile \
if { ![readline_is_used] } {
untested "no tab completion support without readline"
- return -1
+ return
}
gdb_test_no_output "set max-completions unlimited"
diff --git a/gdb/testsuite/gdb.linespec/errors.exp b/gdb/testsuite/gdb.linespec/errors.exp
index 8f60f0eca30b..8e69dd6fa058 100644
--- a/gdb/testsuite/gdb.linespec/errors.exp
+++ b/gdb/testsuite/gdb.linespec/errors.exp
@@ -19,7 +19,7 @@
# another one.
if {[prepare_for_testing "failed to prepare" linespecs keywords.c]} {
- return -1
+ return
}
# PR gdb/12843
diff --git a/gdb/testsuite/gdb.linespec/explicit.exp b/gdb/testsuite/gdb.linespec/explicit.exp
index faee27bab4a5..ccf74d3863d6 100644
--- a/gdb/testsuite/gdb.linespec/explicit.exp
+++ b/gdb/testsuite/gdb.linespec/explicit.exp
@@ -27,7 +27,7 @@ lappend opts additional_flags=-nostdlib
if {[prepare_for_testing "failed to prepare" $exefile \
[list $srcfile $srcfile2 $srcfile3] $opts]} {
- return -1
+ return
}
# Wrap the entire test in a namespace to avoid contaminating other tests.
@@ -98,7 +98,7 @@ namespace eval $testfile {
# Fire up gdb.
if {![runto_main]} {
- return -1
+ return
}
# Turn off queries
diff --git a/gdb/testsuite/gdb.linespec/keywords.exp b/gdb/testsuite/gdb.linespec/keywords.exp
index 36069868f444..ae9380575cf6 100644
--- a/gdb/testsuite/gdb.linespec/keywords.exp
+++ b/gdb/testsuite/gdb.linespec/keywords.exp
@@ -19,11 +19,11 @@ standard_testfile
set exefile $testfile
if {[prepare_for_testing "failed to prepare" $exefile $srcfile {debug}]} {
- return -1
+ return
}
if {![runto_main]} {
- return 0
+ return
}
# Turn off pending breakpoints to facilitate testing errors.
diff --git a/gdb/testsuite/gdb.linespec/linespec.exp b/gdb/testsuite/gdb.linespec/linespec.exp
index 0345fc5098ef..771dede9bb64 100644
--- a/gdb/testsuite/gdb.linespec/linespec.exp
+++ b/gdb/testsuite/gdb.linespec/linespec.exp
@@ -27,7 +27,7 @@ require allow_cplus_tests
if {[prepare_for_testing "failed to prepare" $exefile \
[list $srcfile $baseone $basetwo] \
{debug nowarnings c++}]} {
- return -1
+ return
}
gdb_test_no_output "set multiple-symbols all" \
diff --git a/gdb/testsuite/gdb.linespec/ls-dollar.exp b/gdb/testsuite/gdb.linespec/ls-dollar.exp
index 584ea35447e4..a000c5b39695 100644
--- a/gdb/testsuite/gdb.linespec/ls-dollar.exp
+++ b/gdb/testsuite/gdb.linespec/ls-dollar.exp
@@ -22,7 +22,7 @@ require allow_cplus_tests
if {[prepare_for_testing "failed to prepare" $exefile $srcfile \
{debug nowarnings c++}]} {
- return -1
+ return
}
gdb_test_no_output "set listsize 1"
diff --git a/gdb/testsuite/gdb.linespec/ls-errs.exp b/gdb/testsuite/gdb.linespec/ls-errs.exp
index 1bd6efd10fdf..418d67b82b6b 100644
--- a/gdb/testsuite/gdb.linespec/ls-errs.exp
+++ b/gdb/testsuite/gdb.linespec/ls-errs.exp
@@ -31,14 +31,14 @@ proc do_test {lang} {
if {$lang == "C++"} {
if {![allow_cplus_tests]} {
- return 0
+ return
}
# Build ".c" source file with g++.
lappend options "c++"
}
if {[prepare_for_testing "failed to prepare" $exefile $srcfile $options]} {
- return -1
+ return
}
# Turn off the pending breakpoint queries.
@@ -48,7 +48,7 @@ proc do_test {lang} {
gdb_test_no_output "set max-completions unlimited"
if {![runto_main]} {
- return 0
+ return
}
# Run to a location in the file.
diff --git a/gdb/testsuite/gdb.linespec/macro-relative.exp b/gdb/testsuite/gdb.linespec/macro-relative.exp
index b0ac538be69d..99a6dac78921 100644
--- a/gdb/testsuite/gdb.linespec/macro-relative.exp
+++ b/gdb/testsuite/gdb.linespec/macro-relative.exp
@@ -42,7 +42,7 @@ clean_restart ${testfile}
# "list header_two_func" does not set exactly the one line we want.
if {![runto header_two_func]} {
- return -1
+ return
}
gdb_test "info macro HEADER" "\r\n#define HEADER 2"
diff --git a/gdb/testsuite/gdb.linespec/skip-two.exp b/gdb/testsuite/gdb.linespec/skip-two.exp
index 0a8af84441a3..3c5e438f1177 100644
--- a/gdb/testsuite/gdb.linespec/skip-two.exp
+++ b/gdb/testsuite/gdb.linespec/skip-two.exp
@@ -25,14 +25,14 @@ require allow_cplus_tests
if {[prepare_for_testing "failed to prepare" $execfile \
[list $srcfile $baseone $basetwo] \
{debug nowarnings c++}]} {
- return -1
+ return
}
gdb_test "skip function dupname" \
{Function dupname will be skipped when stepping\.}
if {![runto_main]} {
- return -1
+ return
}
set test "dupname ignored from main"
@@ -64,7 +64,7 @@ gdb_test "skip file thefile.cc" \
{File thefile\.cc will be skipped when stepping\.}
if {![runto_main]} {
- return -1
+ return
}
gdb_test "step" "static int dupname .*" "step into dupname"
diff --git a/gdb/testsuite/gdb.linespec/thread.exp b/gdb/testsuite/gdb.linespec/thread.exp
index 30a21e8fe2fd..ab63fe52a1d9 100644
--- a/gdb/testsuite/gdb.linespec/thread.exp
+++ b/gdb/testsuite/gdb.linespec/thread.exp
@@ -20,11 +20,11 @@ standard_testfile
set exefile $testfile
if {[prepare_for_testing "failed to prepare" $exefile $srcfile {debug}]} {
- return -1
+ return
}
if {![runto_main]} {
- return 0
+ return
}
set bp_location1 [gdb_get_line_number "set breakpoint 1 here"]
next prev parent reply other threads:[~2026-04-27 6:39 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 ` Thiago Jung Bauermann [this message]
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 ` [PATCH 32/36] GDB: testsuite: threads: Don't return 0 " Thiago Jung Bauermann
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-25-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