From: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
To: "Schimpe, Christina" <christina.schimpe@intel.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [PATCH 04/36] GDB: testsuite: intel: Don't return -1 from top-level (manual)
Date: Tue, 28 Apr 2026 18:48:01 -0300 [thread overview]
Message-ID: <87ik9akb8u.fsf@linaro.org> (raw)
In-Reply-To: <SN7PR11MB7638FC1E0808F1ADE7EC4663F9372@SN7PR11MB7638.namprd11.prod.outlook.com> (Christina Schimpe's message of "Tue, 28 Apr 2026 16:39:04 +0000")
Hello Christina,
Thank you for your quick review!
"Schimpe, Christina" <christina.schimpe@intel.com> writes:
> Hi Thiago,
>
> For this patch I have the same comment about the commit message for the "intel" part.
I agree with that comment. I'll adopt your suggestion for v2.
>> diff --git a/gdb/testsuite/gdb.arch/amd64-shadow-stack-cmds.exp
>> b/gdb/testsuite/gdb.arch/amd64-shadow-stack-cmds.exp
>> index e4daecb590dd..266c658eae86 100644
>> --- a/gdb/testsuite/gdb.arch/amd64-shadow-stack-cmds.exp
>> +++ b/gdb/testsuite/gdb.arch/amd64-shadow-stack-cmds.exp
>> @@ -29,7 +29,7 @@ proc restart_and_run_infcall_call2 {} {
>> global binfile
>> clean_restart ${::testfile}
>> if { ![runto_main] } {
>> - return -1
>> + return
>> }
>
> I believe for this specific proc the correct behaviour would be to examine the return
> value and then terminate the test (with a return).
> But the current behaviour is that the test continues in case run_to_main fails.
> Since this is a bug introduced by me, I think you could omit this from this patch.
> I can take care of this separately.
>
> The same issue is in aarch64-gcs-return.exp.😊
Good point that makes sense. I'll leave these changes out from v2.
Thanks for noticing it.
>> set inside_infcall_str "The program being debugged stopped while in a
>> function called from GDB"
>> gdb_breakpoint [ gdb_get_line_number "break call2" ] @@ -44,12 +44,12
>> @@ save_vars { ::env(GLIBC_TUNABLES) } {
>>
>> if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
>> {debug additional_flags="-fcf-protection=return"}] } {
>> - return -1
>> + return
>> }
>>
>> clean_restart ${::testfile}
>> if { ![runto_main] } {
>> - return -1
>> + return
>> }
>>
>> with_test_prefix "test inferior call and continue" { @@ -85,7 +85,7 @@
>> save_vars { ::env(GLIBC_TUNABLES) } {
>>
>> clean_restart ${::testfile}
>> if { ![runto_main] } {
>> - return -1
>> + return
>> }
>>
>> set call1_line [ gdb_get_line_number "break call1" ] @@ -122,7 +122,7
>> @@ save_vars { ::env(GLIBC_TUNABLES) } {
>>
>> clean_restart ${::testfile}
>> if { ![runto_main] } {
>> - return -1
>> + return
>> }
>>
>> with_test_prefix "test return from past frame" { diff --git
>> a/gdb/testsuite/gdb.arch/core-file-pid0.exp b/gdb/testsuite/gdb.arch/core-
>> file-pid0.exp
>> index 8f4f88bcdb6a..3f389a705480 100644
>> --- a/gdb/testsuite/gdb.arch/core-file-pid0.exp
>> +++ b/gdb/testsuite/gdb.arch/core-file-pid0.exp
>> @@ -28,7 +28,7 @@ if {[istarget "x86_64-*-linux*"]} {
>> set cf_size 8757248
>> } else {
>> unsupported "no pre-generated core file for this target"
>> - return -1
>> + return
>> }
>>
>> # Decompress the core file.
>> @@ -36,14 +36,14 @@ set corebz2file ${srcdir}/${subdir}/${cf_name} set
>> corefile [decompress_bz2 $corebz2file] if { $corefile eq "" } {
>> untested "failed to bunzip2 the core file"
>> - return -1
>> + return
>> }
>>
>> # Check the size of the decompressed core file. Just for sanity.
>> file stat ${corefile} corestat
>> if { $corestat(size) != ${cf_size} } {
>> untested "uncompressed core file is the wrong size"
>> - return -1
>> + return
>> }
>>
>> # Copy over the corefile if we are remote testing.
>> diff --git a/gdb/testsuite/gdb.arch/i386-bp_permanent.exp
>> b/gdb/testsuite/gdb.arch/i386-bp_permanent.exp
>> index ef4d0370de89..9805f5626348 100644
>> --- a/gdb/testsuite/gdb.arch/i386-bp_permanent.exp
>> +++ b/gdb/testsuite/gdb.arch/i386-bp_permanent.exp
>> @@ -40,7 +40,7 @@ clean_restart $::testfile #
>>
>> if {![runto_main]} {
>> - return -1
>> + return
>> }
>>
>> set function "standard"
>> @@ -53,8 +53,8 @@ set retcode [gdb_test_multiple "disassemble $function"
>> "disassemble function '$f }]
>>
>> if {$retcode != 0} {
>> - fail "disassemble failed, skipping entire test."
>> - return -1
>> + fail "disassemble failed, skipping entire test."
>> + return
>> }
>>
>> gdb_breakpoint "*$address_bp"
>
> I looked at a few more changes in this series and saw similar issues for the proc return values.
> I guess each return which is inside a proc must be examined individually to find
> out what the correct behaviour should be... what do you think?
Ah, yes that makes sense. Thank you for catching that.
I will make a v2 which only includes top-level return statements
(including the ones within save_vars, with_test_prefix and such). That
should be easier to review. I will also include the "return 0" fixes you
mentioned in the other patch.
--
Thiago
next prev parent reply other threads:[~2026-04-28 21:48 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 [this message]
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 ` [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=87ik9akb8u.fsf@linaro.org \
--to=thiago.bauermann@linaro.org \
--cc=christina.schimpe@intel.com \
--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