This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Prevent crashes using $arg0
- From: Eli Zaretskii <eliz at gnu dot org>
- To: gdb-patches at sourceware dot org
- Date: Tue, 07 Feb 2006 22:38:28 +0200
- Subject: Re: Prevent crashes using $arg0
- References: <20060207193932.GA28960@nevyn.them.org>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> Date: Tue, 7 Feb 2006 14:39:32 -0500
> From: Daniel Jacobowitz <drow@false.org>
>
> 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)