From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20513 invoked by alias); 24 Jan 2006 18:43:56 -0000 Received: (qmail 20503 invoked by uid 22791); 24 Jan 2006 18:43:55 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Tue, 24 Jan 2006 18:43:54 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1F1T8u-0005yX-8Z; Tue, 24 Jan 2006 13:43:48 -0500 Date: Tue, 24 Jan 2006 18:43:00 -0000 From: Daniel Jacobowitz To: Jim Blandy Cc: Andrew STUBBS , Eli Zaretskii , gdb-patches@sources.redhat.com Subject: Re: [RFC] Alternate approach to keeping convenience variables Message-ID: <20060124184348.GA22916@nevyn.them.org> Mail-Followup-To: Jim Blandy , Andrew STUBBS , Eli Zaretskii , gdb-patches@sources.redhat.com 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> <8f2776cb0601241040u3f542b15s2efae535170a6492@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8f2776cb0601241040u3f542b15s2efae535170a6492@mail.gmail.com> User-Agent: Mutt/1.5.8i 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/msg00362.txt.bz2 On Tue, Jan 24, 2006 at 10:40:58AM -0800, Jim Blandy wrote: > 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. > 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. Andrew's point is that such a primitive was recently committed :-) -- Daniel Jacobowitz CodeSourcery