This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v6 3/6] Extended-remote Linux follow fork
- From: Pedro Alves <palves at redhat dot com>
- To: Don Breazeal <donb at codesourcery dot com>, gdb-patches at sourceware dot org
- Date: Tue, 07 Apr 2015 18:35:34 +0100
- Subject: Re: [PATCH v6 3/6] Extended-remote Linux follow fork
- Authentication-results: sourceware.org; auth=none
- References: <1424997977-13316-1-git-send-email-donb at codesourcery dot com> <1426625788-4469-1-git-send-email-donb at codesourcery dot com> <1426625788-4469-4-git-send-email-donb at codesourcery dot com> <551155B8 dot 2080707 at redhat dot com>
On 03/24/2015 12:16 PM, Pedro Alves wrote:
>> > diff --git a/gdb/testsuite/gdb.base/multi-forks.exp b/gdb/testsuite/gdb.base/multi-forks.exp
>> > index e95cb4b..2a71e63 100644
>> > --- a/gdb/testsuite/gdb.base/multi-forks.exp
>> > +++ b/gdb/testsuite/gdb.base/multi-forks.exp
>> > @@ -62,6 +62,23 @@ proc continue_to_exit_bp_loc {} {
>> > set seen_break 0
>> > set seen_prompt 0
>> > set seen_timeout 0
>> > +
>> > + # If we are running with a native gdbserver, the output ($decimal done)
>> > + # will come via the spawn_id of gdbserver, not the spawn_id of gdb (the
>> > + # default). So we grab the spawn_id of gdbserver, if it exists, and
>> > + # add it to the gdb_expect statement below using "-i", allowing us to
>> > + # apply the expect statement to the output of both spawn_ids.
>> > + #
>> > + # If we are running with a truly remote gdbserver (gdb,noinferiorio),
>> > + # the output of the program will be inaccessible. In this case we do
>> > + # not check for the ($decimal done) output, but just look for the gdb
>> > + # prompt.
>> > + global server_spawn_id
>> > + set current_spawn_id [board_info host fileid]
>> > + if {![info exists server_spawn_id]} {
>> > + set server_spawn_id ""
>> > + }
>> > +
>> > while { ($seen_done < 16 || ! $seen_prompt) && ! $seen_timeout } {
>> > # We don't know what order the interesting things will arrive in.
>> > # Using a pattern of the form 'x|y|z' instead of -re x ... -re y
>> > @@ -70,7 +87,8 @@ proc continue_to_exit_bp_loc {} {
>> > # first in the script that occurs anywhere in the input, so that
>> > # we don't skip anything.
>> > gdb_expect {
>> > - -re "($decimal done)|(Breakpoint)|($gdb_prompt)" {
>> > + -i "$current_spawn_id $server_spawn_id" \
>
> Note this is currently working by chance. We need this one in:
>
> https://sourceware.org/ml/gdb-patches/2015-02/msg00659.html
>
> in order to safely be able to do '-i "$server_spawn_id"'.
FYI, I now pushed that series in. Please update this to
use $inferior_spawn_id instead.
Thanks,
Pedro Alves