This is the mail archive of the
gdb@sourceware.cygnus.com
mailing list for the GDB project.
Re: command error handling
- To: gdb at sourceware dot cygnus dot com
- Subject: Re: command error handling
- From: Jim Kingdon <kingdon at redhat dot com>
- Date: 26 Feb 2000 10:27:59 -0800
- Newsgroups: cygnus.gdb
- Organization: Cygnus Solutions
- References: <5mr9e093zj.fsf@jtc.redbacknetworks.com>
> I'll argue that delete should behave like enable and disable, that a
> message be output and execution should continue.
Sounds good to me.
> The problem with error(), IMHO, is that it's very heavy handed. While
> it allows us to avoid the fun of propagating errors up from the lowest
> levels of GDB, it also makes it impossible for user defined functions
> to detect the failure of a command
Well, sometimes the command will fail in its entirety. Or to put it
another way, some errors you can't continue from, for example, in
"delete display foo 4 3 5 2" we might be willing to guess that 4, 3,
5, and 2 are display numbers but in a different case the syntax of the
first part has to be right for the last part to make any sense. One
can presumably find non-syntactic examples too.
I haven't taken a close look at the error() machinery recently and how
it would relate to scripting languages, but there should be some way
to trap the error() and return it back to the script.