This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v6 3/6] Extended-remote Linux follow fork


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]