This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
Re: cli/2451: user-defined commands fail when testing forstructure members that don't exist
- From: Daniel Jacobowitz <drow at false dot org>
- To: nobody at sources dot redhat dot com
- Cc: gdb-prs at sources dot redhat dot com,
- Date: 2 May 2008 16:38:01 -0000
- Subject: Re: cli/2451: user-defined commands fail when testing forstructure members that don't exist
- Reply-to: Daniel Jacobowitz <drow at false dot org>
The following reply was made to PR cli/2451; it has been noted by GNATS.
From: Daniel Jacobowitz <drow@false.org>
To: emf1123@gmail.com
Cc: gdb-gnats@sourceware.org
Subject: Re: cli/2451: user-defined commands fail when testing for
structure members that don't exist
Date: Fri, 2 May 2008 12:36:15 -0400
On Fri, May 02, 2008 at 03:33:09PM -0000, emf1123@gmail.com wrote:
> define mumble
> if $arg0->container->value
> print $arg0->container->value
> else
> print $arg0->value
> end
> end
>
> then "mumble foo" fails if foo->container doesn't exist.
Yes, unfortunately the CLI has no "try" construct and no way to do
logic on types. The Python scripting we're currently working on
will obviously not have this limitation :-)
--
Daniel Jacobowitz
CodeSourcery