This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Implement $_version; for auto-load commands in ~/.gdbinit
On Fri, 24 Aug 2012 18:54:07 +0200, dje@google.com wrote:
> Jan Kratochvil writes:
> > if $_have_ignore_errors
> > set ignore-errors yes
> > add-auto-load-safe-path ~/src
> > set ignore-errors no
> > end
[...]
> For my own education, why is $_have_ignore_errors needed?
> [It doesn't, for example, evaluate to 0 if it doesn't exist.]
It evaluates to void, which is false:
(gdb) p $_x
$1 = void
(gdb) ptype $_x
type = void
$ cat x
if $_x
echo YES\n
else
echo NO\n
end
$ gdb -q -x ./x
NO
Thanks,
Jan