From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18556 invoked by alias); 24 Jan 2006 18:41:01 -0000 Received: (qmail 18545 invoked by uid 22791); 24 Jan 2006 18:41:01 -0000 X-Spam-Check-By: sourceware.org Received: from zproxy.gmail.com (HELO zproxy.gmail.com) (64.233.162.199) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 24 Jan 2006 18:41:00 +0000 Received: by zproxy.gmail.com with SMTP id l1so1157728nzf for ; Tue, 24 Jan 2006 10:40:58 -0800 (PST) Received: by 10.36.127.4 with SMTP id z4mr5052232nzc; Tue, 24 Jan 2006 10:40:58 -0800 (PST) Received: by 10.37.2.42 with HTTP; Tue, 24 Jan 2006 10:40:58 -0800 (PST) Message-ID: <8f2776cb0601241040u3f542b15s2efae535170a6492@mail.gmail.com> Date: Tue, 24 Jan 2006 18:41:00 -0000 From: Jim Blandy To: Andrew STUBBS Subject: Re: [RFC] Alternate approach to keeping convenience variables Cc: Eli Zaretskii , gdb-patches@sources.redhat.com In-Reply-To: <43D60D20.2080004@st.com> 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> <8f2776cb0601231429y38714c9bm830991b4b037ec70@mail.gmail.com> <43D60D20.2080004@st.com> 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/msg00361.txt.bz2 On 1/24/06, Andrew STUBBS wrote: > Jim Blandy wrote: > > 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. > > A newly created convenience variable has the value 'void'. (A variable > is created the first time it is referenced, even as an rvalue.) > Therefore, if it is 'void' it can be considered uninitialised. Right, but there's no way to test for that in the scripting language.=20 Your 'init-if-undefined' command has to be a primitive, implemented in C. My argument was that having the variables always be present is more convenient for user-defined commands.