From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13333 invoked by alias); 28 Oct 2011 17:40:36 -0000 Received: (qmail 13108 invoked by uid 22791); 28 Oct 2011 17:40:34 -0000 X-SWARE-Spam-Status: No, hits=-6.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 28 Oct 2011 17:40:20 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p9SHeHfq020480 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 28 Oct 2011 13:40:17 -0400 Received: from host1.jankratochvil.net (ovpn-116-23.ams2.redhat.com [10.36.116.23]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p9SHeFPg024978 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 28 Oct 2011 13:40:16 -0400 Received: from host1.jankratochvil.net (localhost [127.0.0.1]) by host1.jankratochvil.net (8.14.4/8.14.4) with ESMTP id p9SHeELk026551; Fri, 28 Oct 2011 19:40:14 +0200 Received: (from jkratoch@localhost) by host1.jankratochvil.net (8.14.4/8.14.4/Submit) id p9SHeE0s026550; Fri, 28 Oct 2011 19:40:14 +0200 Date: Fri, 28 Oct 2011 17:42:00 -0000 From: Jan Kratochvil To: Pedro Alves Cc: gdb-patches@sourceware.org, Kevin Pouget , Tom Tromey Subject: Re: [patch] Forbid "run" etc. for use_gdb_stub targets [Re: [patch] gdb.python/py-events.exp: Disable multi-inferior for gdbserver] Message-ID: <20111028174014.GB18885@host1.jankratochvil.net> References: <201110261448.58804.pedro@codesourcery.com> <20111027101700.GA21805@host1.jankratochvil.net> <201110271909.37066.pedro@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201110271909.37066.pedro@codesourcery.com> User-Agent: Mutt/1.5.21 (2010-09-15) 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/msg00770.txt.bz2 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? > > AFAIK there is currently no way to run the whole testsuite in extended > > gdbserver mode. [...] > Missed those. It was for kernel-based ugdb using extended-remote protocol, but I see now it is not worth of a reusal for extended-remote FSF gdbserver run. Re: ugdb for the gdb testsuite (failed) http://sourceware.org/ml/archer/2010-q3/msg00147.html > > + if {[regexp -nocase {^\s*(r|run|star|start|at|att|atta|attac|attach)\M} \ > > + $command] > > + && [target_info exists use_gdb_stub]} { > > + global gdbserver_protocol > > + > > + # gdbserver_start_extended runs as a part of non-extended configuration. > > + if {![info exists gdbserver_protocol] > > + || ![string match "extended-*" $gdbserver_protocol]} { > > + error "gdbserver does not support $command without extended-remote" > > + } > > + } > > I think this should be: > > if {[info exists gdbserver_protocol] > && ![string match "extended-*" $gdbserver_protocol]} { > error "gdbserver does not support $command without extended-remote" > > We don't want to throw an error if gdbserver_protocol does not exist? It was a leftover, thanks; anyway dropped this conditional now when use_gdb_stub should be always correct now. Thanks, Jan gdb/testsuite/ 2011-10-28 Jan Kratochvil * lib/gdb.exp (gdb_test_multiple): Forbid run, start or attach for use_gdb_stub. * lib/gdbserver-support.exp (gdbserver_start): Set use_gdb_stub for gdb_protocol unset from the target board. (gdbserver_start_extended): Set global gdbserver_protocol and gdbserver_gdbport. Unset use_gdb_stub. --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -601,6 +601,12 @@ proc gdb_test_multiple { command message user_code } { error "Invalid newline in \"$message\" test" } + if {[regexp -nocase {^\s*(r|run|star|start|at|att|atta|attac|attach)\M} \ + $command] + && [target_info exists use_gdb_stub]} { + error "gdbserver does not support $command without extended-remote" + } + # 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" } @@ -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] }