Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: Andrew Burgess <aburgess@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 2/3] [gdb/testsuite] Use gdb_exit_cleanup a bit more
Date: Mon, 28 Sep 2026 10:59:41 +0200	[thread overview]
Message-ID: <b5ea2f47-0675-48f8-abb8-c34fceb07965@suse.de> (raw)
In-Reply-To: <87pkxz13gf.fsf@redhat.com>

On 9/27/26 10:52 AM, Andrew Burgess wrote:
> Tom de Vries <tdevries@suse.de> writes:
> 
>> I ran into trouble running test-case gdb.base/quit-live.exp using a remote
>> host configuration:
>> - host board local-remote-host
>> - target board remote-gdbserver-on-localhost.
>>
>> The problem is that the test-case makes gdb quit without updating
>> gdb_spawn_id.  Consequently, default_gdb_exit tries to exit gdb.
>> It does so by sending quit to gdb and waiting for it to exit, which get us:
>> ...
>> ERROR: : spawn id exp9 not open
>> ...
>>
>> Fix this using gdb_exit_cleanup.  Likewise in gdb.threads/killed.exp.
>> ---
>>   gdb/testsuite/gdb.base/quit-live.exp | 1 +
>>   gdb/testsuite/gdb.threads/killed.exp | 1 +
>>   2 files changed, 2 insertions(+)
>>
>> diff --git a/gdb/testsuite/gdb.base/quit-live.exp b/gdb/testsuite/gdb.base/quit-live.exp
>> index 14f87f9b7f8..8dae4fe2aca 100644
>> --- a/gdb/testsuite/gdb.base/quit-live.exp
>> +++ b/gdb/testsuite/gdb.base/quit-live.exp
>> @@ -152,6 +152,7 @@ proc quit_with_live_inferior {appear_how extra_inferior quit_how} {
>>   		gdb_test_multiple "" $test {
>>   		    eof {
>>   			pass $test
>> +			gdb_exit_cleanup
> 
> There's another place in this test script which detects eof from GDB,
> but you've not added the gdb_exit_cleanup call there.
> 
> Should we also be patching that location?  If not why not?  And if the
> answer is there's a good reason why not, then I think it is worth
> mentioning in the commit message, and as a comment at that location in
> the code.
> 

Hi Andrew,

thanks for the review(s).

The focus of this commit is to address a specific error, and the 
addition in quit_with_live_inferior fixes it.

I did not encounter the same error in test_quit_with_sig, but it's 
probably a good idea to apply the same pattern.

[ It might even be necessary on msys2, but AFAIR currently the test-case 
fails in such a way that the eof is not reached.  I briefly tried making 
the testcase work using some kill equivalent, but that didn't work out. ]

Anyway, I've added the gdb_exit_cleanup in test_quit_with_sig, and I've 
updated the commit message to:
...
     Fix this in quit_with_live_inferior using gdb_exit_cleanup.
     Likewise in gdb.threads/killed.exp.

     While we're at it, also add default_gdb_exit for another eof clause
     in gdb.base/quit-live.exp, in proc test_quit_with_sig.
...
and pushed.

Thanks,
- Tom

> Thanks,
> Andrew
> 


  reply	other threads:[~2026-09-28  9:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-19  8:42 [PATCH 0/3] [gdb/testsuite] Fix gdb.base/quit-live.exp for remote host Tom de Vries
2026-09-19  8:42 ` [PATCH 1/3] [gdb/testsuite] Add gdb_exit_cleanup Tom de Vries
2026-09-27  8:52   ` Andrew Burgess
2026-09-19  8:42 ` [PATCH 2/3] [gdb/testsuite] Use gdb_exit_cleanup a bit more Tom de Vries
2026-09-27  8:52   ` Andrew Burgess
2026-09-28  8:59     ` Tom de Vries [this message]
2026-09-19  8:42 ` [PATCH 3/3] [gdb/testsuite] Fix gdb.base/quit-live.exp for remote host Tom de Vries

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=b5ea2f47-0675-48f8-abb8-c34fceb07965@suse.de \
    --to=tdevries@suse.de \
    --cc=aburgess@redhat.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