Re: [PATCH] MI error messages

Bob Rossi
2005-06-22T13:04:38Z

On Tue, Jun 21, 2005 at 02:59:11PM -0700, Jason Molenda wrote:
>
> On Jun 21, 2005, at 2:44 PM, Nick Roberts wrote:
>
> >I presumed mi_usage_error would call error. That way the error is
> >caught and
> >any cleanups and rewinds are done. However, you are right, it
> >would be nicer
> >just to get:
> >
> >(gdb)
> >-stack-select-frame
> >Usage: FRAME_SPEC.
> >(gdb)
> >
> >instead of
> >
> >(gdb)
> >-stack-select-frame
> >&"Usage: -stack-select-frame FRAME_SPEC\n"
> >^error,msg="Usage: -stack-select-frame FRAME_SPEC"
> >(gdb)
> >
> >as these errors aren't intended for the user when the frontend is
> >being used.
>
>
> Yeah, we came to the same decision at Apple. When you throw error()
> while in MI mode, you only get the ^error message, you don't get the
> console-style &"..." with the same message. Our GUI has a little
> status line at the bottom of the window where it shows the error
> message, and if you have the "gdb console" window open, it shows the
> error text in a different color to differentiate the error message.
> It makes sense to let the GUI show the error in whatever way is most
> appropriate for it, instead of blotting back plain old text.

It would probably even make more sense if it the error message said
something like,
^error,msg="Usage: -stack-select-frame FRAME_SPEC",reason=USAGE_NOTE
That way, there is text associated with the error message, but the FE
can also easily understand what type of error it is receiving, and
perform different operations on that data. I can only guess that someone
is doing a strcmp on that Usage message ...

Bob Rossi