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 v5] Introduce target_is_gdbserver


On 12/05/2014 06:34 PM, Simon Marchi wrote:

> diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
> index a29b661..b420e00 100644
> --- a/gdb/testsuite/lib/gdb.exp
> +++ b/gdb/testsuite/lib/gdb.exp
> @@ -5004,5 +5004,30 @@ proc capture_command_output { command prefix } {
>      return $output_string
>  }
> 
> +# Return 1 if the current remote target is an instance of our GDBserver, 0
> +# otherwise.  Return -1 if there was an error and we can't tell.
> +
> +gdb_caching_proc target_is_gdbserver {
> +    global gdb_prompt
> +
> +    set is_gdbserver -1
> +    set test "Probing for GDBserver"
> +
> +    gdb_test_multiple "monitor help" $test {
> +	-re "The following monitor commands are supported.*Quit GDBserver.*$gdb_prompt $" {
> +	    set is_gdbserver 1
> +	}
> +	-re "$gdb_prompt $" {
> +	    set is_gdbserver 0
> +	}
> +    }
> +
> +    if { $is_gdbserver == -1 } {
> +	verbose -log "Unable to tell whether we are using GDBserver or not."
> +    }
> +
> +    return $is_gdbserver
> +}
> +

I think it'd be nice to have this close to gdb_is_target_remote.
How about moving it just below that one?

Anyway, this is OK.  Please push.

Thanks,
Pedro Alves


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