This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
On 1/24/06, Daniel Jacobowitz <drow@false.org> wrote:Andrew's point is that such a primitive was recently committed :-)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.
If you want your user-defined command to print a helpful error mesage, you can't use that in an 'if'. If we had some operator like $defined($foo), then that'd be different.
define defined set $temp = $arg0 init-if-undefined $temp = 99999 if $temp == 99999 echo $arg0 not defined\n end end
(gdb) defined $a $a not defined (gdb) defined $tpnum (gdb)
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |