From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20008 invoked by alias); 5 Dec 2011 21:52:23 -0000 Received: (qmail 19998 invoked by uid 22791); 5 Dec 2011 21:52:23 -0000 X-SWARE-Spam-Status: No, hits=-3.9 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-vw0-f41.google.com (HELO mail-vw0-f41.google.com) (209.85.212.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 05 Dec 2011 21:52:10 +0000 Received: by vbbfn1 with SMTP id fn1so1996148vbb.0 for ; Mon, 05 Dec 2011 13:52:09 -0800 (PST) Received: by 10.52.20.35 with SMTP id k3mr6528479vde.34.1323121928166; Mon, 05 Dec 2011 13:52:08 -0800 (PST) MIME-Version: 1.0 Received: by 10.52.20.35 with SMTP id k3mr6528464vde.34.1323121928003; Mon, 05 Dec 2011 13:52:08 -0800 (PST) Received: by 10.220.97.211 with HTTP; Mon, 5 Dec 2011 13:52:07 -0800 (PST) In-Reply-To: References: <201110271909.37066.pedro@codesourcery.com> <20111028174014.GB18885@host1.jankratochvil.net> <201110281917.44839.pedro@codesourcery.com> <20111029194745.GA12850@host1.jankratochvil.net> <20111203183613.GA15496@host2.jankratochvil.net> <20111204012935.GA4034@host2.jankratochvil.net> <20111205201553.GA22427@host2.jankratochvil.net> Date: Mon, 05 Dec 2011 23:36:00 -0000 Message-ID: Subject: Re: ping: Re: [patch] Forbid "run" etc. for use_gdb_stub targets From: Doug Evans To: Jan Kratochvil Cc: Pedro Alves , gdb-patches@sourceware.org, Kevin Pouget , Tom Tromey Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true 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/msg00156.txt.bz2 On Mon, Dec 5, 2011 at 1:27 PM, Doug Evans wrote: > On Mon, Dec 5, 2011 at 12:15 PM, Jan Kratochvil > wrote: >> On Sun, 04 Dec 2011 03:55:07 +0100, Doug Evans wrote: >>> Poorly chosen names lead to confusion, bugs, and wasted time. >>> [No claim is made that this is news. :-)] >> >> Just $use_gdb_stub is a different form of [target_info exists use_gdb_st= ub] so >> no matter what the name is IMO it is correct the name is the same. >> >> And one cannot change use_gdb_stub in the board file for board files bac= kward >> compatibility. > > I realize that. =A0grep use_gdb_stub /usr/share/dejagnu/baseboards/*.exp. > ref: http://sourceware.org/ml/gdb-patches/2011-12/msg00048.html > > I was suggesting either a layer of abstraction and/or have gdbserver > set something with a more meaningful name, and use the more meaningful > name in contexts where we currently use use_gdb_stubs. > > [btw, once gdb_stubs is gone, I think we should also remove (at least > in name) use_gdb_stubs, at least within gdb. =A0Otherwise we're not > finishing the job of cleaning things up.] > >>> Plus, there's no reason why, for example, gdb_start_cmd can't work >>> with target remote and gdbserver. >> >> It does not work with non-extended gdbserver - which has use_gdb_stub = =3D=3D 1. >> Also my change did not change it: >> - =A0 =A0if [target_info exists use_gdb_stub] { >> + =A0 =A0if $use_gdb_stub { >> (gdb) target remote localhost:1234 >> Remote debugging using localhost:1234 >> [...] >> (gdb) start >> The "remote" target does not support "run". =A0Try "help target" or "con= tinue". > > I realize "target remote" doesn't support "start". > What I meant was there's no reason why gdb_start_cmd couldn't do > something like the following for non-extended-remote gdbserver: > > tbreak main > continue btw ... I realize gdb.{ada,base}/start.exp uses gdb_start_cmd to actually test the start command. There are two independent uses of gdb_start_cmd in the testsuite: 1) test the "start" command 2) runto main without the side-effects of runto_main (delete all breakpoint= s) If you want to add a parameter to runto_main, or some such, to skip the side-effects, that's another way to go. I don't have strong feelings on actually splitting up gdb_start_cmd into tw= o.