From: Pedro Alves <palves@redhat.com>
To: Simon Marchi <simon.marchi@ericsson.com>,
Sergio Durigan Junior <sergiodj@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH v2] Introduce remote_target_is_gdbserver
Date: Thu, 11 Sep 2014 16:46:00 -0000 [thread overview]
Message-ID: <5411D1D9.4030107@redhat.com> (raw)
In-Reply-To: <5411B618.5060800@ericsson.com>
On 09/11/2014 03:47 PM, Simon Marchi wrote:
> On 14-09-05 07:30 PM, Sergio Durigan Junior wrote:
>>> # Check whether we're testing with our own GDBserver.
>>> -set is_gdbserver -1
>>> -set test "probe for GDBserver"
>>> -gdb_test_multiple "monitor help" $test {
>>> - -re "The following monitor commands are supported.*debug-hw-points.*remote-debug.*GDBserver.*$gdb_prompt $" {
>>> - set is_gdbserver 1
>>> - pass $test
>>> - }
>>> - -re "$gdb_prompt $" {
>>> - set is_gdbserver 0
>>> - pass $test
>>> - }
>>> -}
>>> +# Return true if the current remote target is an instance of gdbserver.
>>> +
>>> +proc remote_target_is_gdbserver { } {
>>> + global gdb_prompt
>>> +
>>> + set is_gdbserver 0
>>> + set test "Probing for GDBserver"
>>> +
>>> + gdb_test_multiple "monitor help" $test {
>>> + -re "The following monitor commands are supported.*Quit GDBserver.*$gdb_prompt $" {
>>> + pass $test
>>> + set is_gdbserver 1
>>> + }
>>> + -re "$gdb_prompt $" {
>>> + pass $test
>>> + }
>>> + default {
>>> + pass $test
>>> + }
>>
>> Do we really need these "pass"? I'd rather we don't put it, and by
>> looking at lib/gdb.exp I see many tests also don't use it.
>
> I thought so, but apparently no. I thought that each gdb_test_multiple had to be matched with one pass or fail.
FWIW, yeah, that was the original rationale behind the "pass"es
in the original code. The test was written in the form of
"Probing for GDBserver", and the idea is that if we find that we're
not running GDBserver but something else, the _probing_ itself was
still a success.
Thanks,
Pedro Alves
prev parent reply other threads:[~2014-09-11 16:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-05 20:21 Simon Marchi
2014-09-05 23:30 ` Sergio Durigan Junior
2014-09-11 14:47 ` Simon Marchi
2014-09-11 16:46 ` Pedro Alves [this message]
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=5411D1D9.4030107@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=sergiodj@redhat.com \
--cc=simon.marchi@ericsson.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