From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27820 invoked by alias); 5 Sep 2014 23:30:45 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 27799 invoked by uid 89); 5 Sep 2014 23:30:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.1 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 05 Sep 2014 23:30:39 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s85NUYpi008860 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 5 Sep 2014 19:30:35 -0400 Received: from localhost (dhcp-10-15-16-169.yyz.redhat.com [10.15.16.169]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s85NUYRv032102 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NO); Fri, 5 Sep 2014 19:30:34 -0400 From: Sergio Durigan Junior To: Simon Marchi Cc: Subject: Re: [PATCH v2] Introduce remote_target_is_gdbserver References: <1409948495-13599-1-git-send-email-simon.marchi@ericsson.com> X-URL: http://www.redhat.com Date: Fri, 05 Sep 2014 23:30:00 -0000 In-Reply-To: <1409948495-13599-1-git-send-email-simon.marchi@ericsson.com> (Simon Marchi's message of "Fri, 5 Sep 2014 16:21:35 -0400") Message-ID: <87k35h3asl.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2014-09/txt/msg00163.txt.bz2 On Friday, September 05 2014, Simon Marchi wrote: > Oops, I had some unstaged changes when I sent this patch, so here is > an updated one with those changes. Sorry for the noise. > > This patch introduces a function in gdbserver-support.exp to find out > whether the current target is GDBserver. > > The code was inspired from gdb.trace/qtor.exp, so it replaces the code > there by a call to the new function. Hi Simon, Thanks for the patch. A few comments. > gdb/testsuite/ChangeLog: > > * lib/gdbserver-support.exp (remote_target_is_gdbserver): New > fonction. Typo: fonction. You also forgot to mention the change to gdb.trace/qtro.exp. > --- > gdb/testsuite/gdb.trace/qtro.exp | 14 +------------- > gdb/testsuite/lib/gdbserver-support.exp | 23 +++++++++++++++++++++++ > 2 files changed, 24 insertions(+), 13 deletions(-) > > diff --git a/gdb/testsuite/gdb.trace/qtro.exp b/gdb/testsuite/gdb.trace/qtro.exp > index 22b5051..95b6b85 100644 > --- a/gdb/testsuite/gdb.trace/qtro.exp > +++ b/gdb/testsuite/gdb.trace/qtro.exp > @@ -98,19 +98,7 @@ if { $traceframe_info_supported == -1 } { > } > > # 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 > - } > -} > -if { $is_gdbserver == -1 } { > +if ![remote_target_is_gdbserver] { I know it's just a matter of style, but I'd prefer if you kept the surrounding brackets in the condition: if { ![remote_target_is_gdbserver] } { ... > return -1 > } > > diff --git a/gdb/testsuite/lib/gdbserver-support.exp b/gdb/testsuite/lib/gdbserver-support.exp > index 8c91e28..300c3db 100644 > --- a/gdb/testsuite/lib/gdbserver-support.exp > +++ b/gdb/testsuite/lib/gdbserver-support.exp > @@ -419,3 +419,26 @@ proc mi_gdbserver_start_multi { } { > > return [mi_gdb_target_cmd $gdbserver_protocol $gdbserver_gdbport] > } > + > +# 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. > + } > + return $is_gdbserver > +} Otherwise, looks good to me (this is not an approval). Cheers, -- Sergio GPG key ID: 0x65FC5E36 Please send encrypted e-mail if possible http://sergiodj.net/