From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20073 invoked by alias); 7 Feb 2006 20:46:25 -0000 Received: (qmail 20065 invoked by uid 22791); 7 Feb 2006 20:46:25 -0000 X-Spam-Check-By: sourceware.org Received: from gandalf.inter.net.il (HELO gandalf.inter.net.il) (192.114.186.17) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 07 Feb 2006 20:46:24 +0000 Received: from nitzan.inter.net.il (nitzan.inter.net.il [192.114.186.20]) by gandalf.inter.net.il (MOS 3.7.1-GA) with ESMTP id HUR27343; Tue, 7 Feb 2006 22:38:29 +0200 (IST) Received: from HOME-C4E4A596F7 (IGLD-80-230-17-245.inter.net.il [80.230.17.245]) by nitzan.inter.net.il (MOS 3.7.3-GA) with ESMTP id CQO20113 (AUTH halo1); Tue, 7 Feb 2006 22:38:28 +0200 (IST) Date: Tue, 07 Feb 2006 20:46:00 -0000 Message-Id: From: Eli Zaretskii To: gdb-patches@sourceware.org In-reply-to: <20060207193932.GA28960@nevyn.them.org> (message from Daniel Jacobowitz on Tue, 7 Feb 2006 14:39:32 -0500) Subject: Re: Prevent crashes using $arg0 Reply-to: Eli Zaretskii References: <20060207193932.GA28960@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-02/txt/msg00156.txt.bz2 > Date: Tue, 7 Feb 2006 14:39:32 -0500 > From: Daniel Jacobowitz > > This patch fixes a crash Andrew Stubbs reported: > > if 1 == 1 > print $arg0 > end > > The new response is: > $arg0 used outside of any user function Is it possible to have $arg0 behave outside user-defined functions as any other convenience variable? That is, can we have this response instead: (gdb) if 1 == 1 >print $arg0 >end $1 = void (gdb) ? If this is not too hard, it's cleaner, since it doesn't reserve the names of these variables globally. [Time passes...] Actually, I'm quite sure we should behave like I suggested, since we already do that without the if clause: (gdb) print $arg0 $1 = void (gdb)