From: Antoine Tremblay <antoine.tremblay@ericsson.com>
To: Pedro Alves <palves@redhat.com>
Cc: Antoine Tremblay <antoine.tremblay@ericsson.com>,
<gdb-patches@sourceware.org>
Subject: Re: [PATCH v2] Fix failure to detach if threads exit while detaching on linux
Date: Fri, 03 Jun 2016 15:59:00 -0000 [thread overview]
Message-ID: <wwokr3cejmbg.fsf@ericsson.com> (raw)
In-Reply-To: <49f3eb1e-d03d-e434-a831-e40f18f7823c@redhat.com>
Pedro Alves writes:
> On 06/03/2016 04:32 PM, Antoine Tremblay wrote:
>>>> >> + #Don't try to exit gdbserver see above comment.
>>>> >> + set gdbserver_reconnect_p 1
>>> >
>>> > I don't understand this one. It shouldn't be needed.
>>> >
>> This one is needed since on the teardown of the .exp test gdb_exit is
>> called and calls monitor_exit which fails with a timeout this avoids
>> this and the original gdb_exit is called.
>
> Then that strikes me as the wrong thing to do. We should instead
> expect that gdbserver exits cleanly, and then clear server_spawn_id.
>
> E.g.:
>
> proc test_server_exit {} {
> global server_spawn_id
> if ![info exists server_spawn_id] {
> return
> }
>
> set test "server exits"
> gdb_expect {
> -i $server_spawn_id
> eof {
> pass $test
> wait -i $server_spawn_id
> unset server_spawn_id
> }
> timeout {
> fail "$test (timeout)"
> }
> }
> }
> }
>
> and then:
>
> -re "Detaching from .*, process $decimal\r\nEnding remote debugging\.\r\n$gdb_prompt $" {
> # This is what you get with "target remote".
> pass $test
> # If testing with gdbserver, make sure it manages to exit.
> test_server_exit
> }
>
Thanks does seems much better !
However, testing it it triggers the test_server_exit timeout case, I'm
guessing because eof already happened and we're waiting for nothing ?
I'm tempted just to unset the var... but ideas are welcome..
Regards,
Antoine
next prev parent reply other threads:[~2016-06-03 15:59 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-02 14:16 [PATCH] " Antoine Tremblay
2016-06-03 11:43 ` Pedro Alves
2016-06-03 11:55 ` Antoine Tremblay
2016-06-03 12:05 ` Pedro Alves
2016-06-03 14:49 ` [PATCH v2] " Antoine Tremblay
2016-06-03 15:16 ` Pedro Alves
2016-06-03 15:32 ` Antoine Tremblay
2016-06-03 15:45 ` Pedro Alves
2016-06-03 15:59 ` Antoine Tremblay [this message]
2016-06-03 16:21 ` Pedro Alves
2016-06-03 16:43 ` [PATCH v3] " Antoine Tremblay
2016-06-03 19:15 ` Pedro Alves
2016-06-03 19:32 ` Antoine Tremblay
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=wwokr3cejmbg.fsf@ericsson.com \
--to=antoine.tremblay@ericsson.com \
--cc=gdb-patches@sourceware.org \
--cc=palves@redhat.com \
/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