From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10168 invoked by alias); 28 Oct 2011 18:18:08 -0000 Received: (qmail 10154 invoked by uid 22791); 28 Oct 2011 18:18:07 -0000 X-SWARE-Spam-Status: No, hits=-1.7 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; Fri, 28 Oct 2011 18:17:50 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=EU1-MAIL.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1RJr01-0003JV-Jd from pedro_alves@mentor.com ; Fri, 28 Oct 2011 11:17:49 -0700 Received: from scottsdale.localnet ([172.16.63.104]) by EU1-MAIL.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.1830); Fri, 28 Oct 2011 19:17:47 +0100 From: Pedro Alves To: Jan Kratochvil Subject: Re: [patch] Forbid "run" etc. for use_gdb_stub targets [Re: [patch] gdb.python/py-events.exp: Disable multi-inferior for gdbserver] Date: Fri, 28 Oct 2011 18:32:00 -0000 User-Agent: KMail/1.13.6 (Linux/2.6.38-11-generic; KDE/4.7.1; x86_64; ; ) Cc: gdb-patches@sourceware.org, Kevin Pouget , Tom Tromey References: <201110271909.37066.pedro@codesourcery.com> <20111028174014.GB18885@host1.jankratochvil.net> In-Reply-To: <20111028174014.GB18885@host1.jankratochvil.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201110281917.44839.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-10/txt/msg00773.txt.bz2 On Friday 28 October 2011 18:40:14, Jan Kratochvil wrote: > On Thu, 27 Oct 2011 20:09:36 +0200, Pedro Alves wrote: > > Not sure what you mean. Is is that use_gdb_stub will be wrong? > > Maybe we can override it? > > Done overriding both ways, to have use_gdb_stub always right. > > Do you agree with it this way? Yes, but see below. > It was a leftover, thanks; anyway dropped this conditional now when > use_gdb_stub should be always correct now. Ah, much better. > + > # TCL/EXPECT WART ALERT > # Expect does something very strange when it receives a single braced > # argument. It splits it along word separators and performs substitutions. > --- a/gdb/testsuite/lib/gdbserver-support.exp > +++ b/gdb/testsuite/lib/gdbserver-support.exp > @@ -206,6 +206,7 @@ proc gdbserver_start { options arguments } { > if [target_info exists gdb_protocol] { > set protocol [target_info gdb_protocol] > } else { > + set_currtarget_info use_gdb_stub 1 > set protocol "remote" > } Isn't this too late though? We do the [target_info exists use_gdb_stub] check at the top of the test files, before gdbserver_start has had a chance of running. So I'm guessing that in the first test that runs right after the gdb.server/ tests complete, use_gdb_stub will be wrong at the top of the test, but it'll get fixed by that test, so the following ones are right. If that test file happen to have a use_gdb_stub check, it'll lose. We may need to do this closer to gdb_init/default_gdb_init (or an override). > > @@ -337,9 +338,13 @@ proc gdbserver_reconnect { } { > > # Start and connect to a gdbserver in extended mode. > proc gdbserver_start_extended { } { > + global gdbserver_protocol > + global gdbserver_gdbport > + > set res [gdbserver_start "--multi" ""] > set gdbserver_protocol "extended-[lindex $res 0]" > set gdbserver_gdbport [lindex $res 1] > + unset_currtarget_info use_gdb_stub > > return [gdb_target_cmd $gdbserver_protocol $gdbserver_gdbport] > } > -- Pedro Alves