Re: [PATCH] MI error messages

Daniel Jacobowitz
2005-06-22T03:32:27Z

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.

I'm not sure what you're agreeing with here. I think it makes plenty
of sense to update error handling to just show the ^error, not &"..."
also - though that is an incompatible change and would need some
wider testing. I strongly disagree with outputing unformatted errors
as in Nick's first example, though.

We have a syntax for error messages... let's use it?
--
Daniel Jacobowitz
CodeSourcery, LLC