From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17151 invoked by alias); 23 Jan 2006 22:29:29 -0000 Received: (qmail 17143 invoked by uid 22791); 23 Jan 2006 22:29:29 -0000 X-Spam-Check-By: sourceware.org Received: from zproxy.gmail.com (HELO zproxy.gmail.com) (64.233.162.202) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 23 Jan 2006 22:29:27 +0000 Received: by zproxy.gmail.com with SMTP id l1so935588nzf for ; Mon, 23 Jan 2006 14:29:25 -0800 (PST) Received: by 10.36.148.13 with SMTP id v13mr4326797nzd; Mon, 23 Jan 2006 14:29:24 -0800 (PST) Received: by 10.37.2.42 with HTTP; Mon, 23 Jan 2006 14:29:24 -0800 (PST) Message-ID: <8f2776cb0601231429y38714c9bm830991b4b037ec70@mail.gmail.com> Date: Mon, 23 Jan 2006 22:29:00 -0000 From: Jim Blandy To: Eli Zaretskii Subject: Re: [RFC] Alternate approach to keeping convenience variables Cc: gdb-patches@sources.redhat.com, Andrew STUBBS In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <4381DC75.80800@st.com> <8f2776cb0511212138g2adef40cr1632365c00e3bebc@mail.gmail.com> <43835114.5060401@st.com> <20051209205923.GA21331@nevyn.them.org> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-01/txt/msg00342.txt.bz2 On 12/10/05, Eli Zaretskii wrote: > > Date: Fri, 9 Dec 2005 15:59:23 -0500 > > From: Daniel Jacobowitz > > Cc: Jim Blandy , gdb-patches@sources.redhat.com > > > > The tracepoint.c change is necessary for default.exp. To see why, try > > this: > > $ gdb > > (gdb) show convenience > > $trace_frame =3D -1 > > $tpnum =3D 0 > > > > vs. > > $ gdb /bin/ls > > (gdb) show convenience > > No debugger convenience variables now defined. > > Convenience variables have names starting with "$"; > > use "set" as in "set $foo =3D 5" to define them. > > > > If you want the inconsistency resolve the other way round, please > > holler. > > I understand that, with your change, GDB will behave as in the second > example, even if no executable file was loaded yet, yes? If so, I'm > for this change: I think GDB shouldn't show tracepoint-related > variables unless tracepoints are actually being used. [leaving lots of context in, since it's been a while] The $trace_frame variable is set to -1 when GDB starts, which indicates that there's no trace frame selected. I think it would be a little more helpful for the variables to always exist: you can write user-defined commands that give a reasonable error message, for example. GDB doesn't have any way (?) to check whether a convenience variable has been initialized yet.