From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6815 invoked by alias); 3 Dec 2011 19:15:17 -0000 Received: (qmail 6801 invoked by uid 22791); 3 Dec 2011 19:15:15 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 03 Dec 2011 19:15:02 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=EU1-MAIL.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1RWv36-0004oR-Tf from pedro_alves@mentor.com ; Sat, 03 Dec 2011 11:15:01 -0800 Received: from scottsdale.localnet ([172.16.63.104]) by EU1-MAIL.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.1830); Sat, 3 Dec 2011 19:14:54 +0000 From: Pedro Alves To: Jan Kratochvil Subject: Re: ping: Re: [patch] Forbid "run" etc. for use_gdb_stub targets Date: Sat, 03 Dec 2011 19:15:00 -0000 User-Agent: KMail/1.13.6 (Linux/2.6.38-13-generic; KDE/4.7.2; x86_64; ; ) Cc: gdb-patches@sourceware.org, Kevin Pouget , Tom Tromey References: <20111029194745.GA12850@host1.jankratochvil.net> <20111203183613.GA15496@host2.jankratochvil.net> In-Reply-To: <20111203183613.GA15496@host2.jankratochvil.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201112031914.52387.pedro@codesourcery.com> X-IsSubscribed: yes 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 X-SW-Source: 2011-12/txt/msg00083.txt.bz2 On Saturday 03 December 2011 18:36:13, Jan Kratochvil wrote: > I am a bit reluctant to check it on my own as I already made there some > mistakes before. I see there is more work going on with this code. Sorry, and thanks. I completely forgot about this until I saw Doug's patch. > --- a/gdb/testsuite/gdb.base/valgrind-db-attach.exp > +++ b/gdb/testsuite/gdb.base/valgrind-db-attach.exp > @@ -41,6 +41,9 @@ pass $test > # Declare GDB now as running. > set gdb_spawn_id -1 > > +# This value applies to GDB spawned by valgrind --db-attach=yes. > +set use_gdb_stub 1 Why? > --- a/gdb/testsuite/lib/gdbserver-support.exp > +++ b/gdb/testsuite/lib/gdbserver-support.exp > @@ -22,6 +22,14 @@ > # > # set_board_info gdb_protocol "remote" > # Unles you have a gdbserver that uses a different protocol... > +# After GDB starts you should check global $gdbserver_protocol instead as > +# the testfile may force a specific different target protocol itself. > +# > +# set_board_info use_gdb_stub > +# Flag the inferior is already started after connecting and run/attach > +# are not supported. This is used for the "remote" protocol. > +# After GDB starts you should check global $use_gdb_stub instead as the > +# testfile may force a specific different target protocol itself. This is the wrong place to document this. use_gdb_stub is not really gdbserver-specific. Please document it in the common framework, somewhere in gdb.exp? > # Start and connect to a gdbserver in extended mode. > proc gdbserver_start_extended { } { > + global gdbserver_protocol > + global gdbserver_gdbport > + global use_gdb_stub > + > set res [gdbserver_start "--multi" ""] > set gdbserver_protocol "extended-[lindex $res 0]" > set gdbserver_gdbport [lindex $res 1] > > + # For both native mode and for stub-using gdbserver target board we run > + # a new gdbserver in extended-remote mode, therefore without stub. > + set use_gdb_stub 0 I suggest instead: # Even if the board file is testing with target remote, our caller # wants to test against gdbserver in extended-remote mode. Make sure to # disable stub-like techniques. > + > return [gdb_target_cmd $gdbserver_protocol $gdbserver_gdbport] > } Otherwise looks good to me. -- Pedro Alves