From: Bob Rossi <bob@brasko.net>
To: Nick Roberts <nickrob@snap.net.nz>,
Bjarke Viksoe <bviksoe@hotmail.com>,
gdb@sourceware.org
Subject: Re: MI error msgs and localization
Date: Wed, 15 Feb 2006 01:55:00 -0000 [thread overview]
Message-ID: <20060215015631.GE1671@brasko.net> (raw)
In-Reply-To: <20060214210505.GA817@nevyn.them.org>
On Tue, Feb 14, 2006 at 04:05:05PM -0500, Daniel Jacobowitz wrote:
> On Wed, Feb 15, 2006 at 09:58:23AM +1300, Nick Roberts wrote:
> > > I don't particular like to hard-code these strings. The list of messages I
> > > gave previously are all marked as console-stream-output. What I am saying is
> > > that localizing such error messages will hurt MI dependant tools since the
> > > messages are highly useful for the front-end. I'm not sure what purpose
> > > console-output really has in a Machine Interface as it tends to make sense
> > > only to humans - but I guess some systems are making use of them.
> > >
> > > What I'd really like is to see them also wrapped in result-records (sample;
> > > ignore syntax):
> > >
> > > ^failed,type="init-option-unrecognized",msg="Unrecognized option"
> > >
> > > Does that make any sense?
> >
> > We've already got ^error as a result field so it doesn't make any sense to me,
> > and if "Unrecognized option" comes from the console stream then I think that
> > can still change. The problem seems to be that of handling CLI error output
> > in MI. I see that the standard GNU error function provides for an error
> > number which is less likely to change:
> >
> > -- Function: void error (int STATUS, int ERRNUM, const char *FORMAT,
> > ...)
> >
> > I wonder if GDB's error function could have one for MI e.g
> >
> > &"Unrecognized option\n"
> > ^error,msg="Unrecognized option",code="35"
> >
> > or even
> >
> > &"Unrecognized option\n"
> > ^error,code="35"
> >
> > instead of just:
> >
> > &"Unrecognized option\n"
> > ^error,msg="Unrecognized option"
>
> GCC developers spent a lot of time talking about this. I think the
> trick to doing this right is actually to do it the way Bjarke
> suggested: msg= as a free-form, explanatory text, and type= (or code=,
> or something else) as a documented identifier. But using numbers for
> the identifiers is not necessarily a good idea, because keeping track
> of them is error-prone. I'd suggest that
> type="init-option-unrecognized" was a lot more memorable than
> "code=35".
I could not agree more here. I think every single error message has to
have a corresponding reason that the FE can understand. For instance, if
the FE is parsing the error message currently generated, it should be
prepared that the message can change at any given time. Any parsing of
the error message is a bad idea. It's as bad as parsing the CLI output.
The only way that MI should pass an error status back to the FE is
through a type="init-option-unrecognized". Each of these error responses
should be documented just like the asynchronous response reasons.
This is the only way to go, IMO.
Bob Rossi
prev parent reply other threads:[~2006-02-15 1:55 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-12 14:54 Bjarke Viksoe
2006-02-12 20:49 ` Nick Roberts
2006-02-13 18:37 ` Bjarke Viksoe
2006-02-13 19:56 ` Eli Zaretskii
2006-02-13 20:01 ` Daniel Jacobowitz
2006-02-14 1:30 ` Nick Roberts
2006-02-14 17:40 ` Bjarke Viksoe
2006-02-14 19:42 ` Eli Zaretskii
2006-02-14 20:59 ` Nick Roberts
2006-02-14 21:05 ` Daniel Jacobowitz
2006-02-14 23:26 ` Nick Roberts
2006-02-14 23:32 ` Daniel Jacobowitz
2006-02-15 1:48 ` Nick Roberts
2006-02-15 3:05 ` Daniel Jacobowitz
2006-02-15 4:48 ` Nick Roberts
2006-02-15 13:37 ` Daniel Jacobowitz
2006-02-15 21:03 ` Nick Roberts
2006-02-15 21:17 ` Daniel Jacobowitz
2006-02-15 1:55 ` Bob Rossi [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060215015631.GE1671@brasko.net \
--to=bob@brasko.net \
--cc=bviksoe@hotmail.com \
--cc=gdb@sourceware.org \
--cc=nickrob@snap.net.nz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox