From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29003 invoked by alias); 11 Sep 2014 16:46:28 -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 28981 invoked by uid 89); 11 Sep 2014 16:46:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_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; Thu, 11 Sep 2014 16:46:26 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s8BGkKPh024125 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 11 Sep 2014 12:46:20 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s8BGkIFr022561; Thu, 11 Sep 2014 12:46:18 -0400 Message-ID: <5411D1D9.4030107@redhat.com> Date: Thu, 11 Sep 2014 16:46:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.7.0 MIME-Version: 1.0 To: Simon Marchi , Sergio Durigan Junior CC: gdb-patches@sourceware.org Subject: Re: [PATCH v2] Introduce remote_target_is_gdbserver References: <1409948495-13599-1-git-send-email-simon.marchi@ericsson.com> <87k35h3asl.fsf@redhat.com> <5411B618.5060800@ericsson.com> In-Reply-To: <5411B618.5060800@ericsson.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-09/txt/msg00363.txt.bz2 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