Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Vladimir Prus <vladimir@codesourcery.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [MI non-stop 04/11] Implement --thread and --frame.
Date: Sun, 29 Jun 2008 06:10:00 -0000	[thread overview]
Message-ID: <200806291005.14181.vladimir@codesourcery.com> (raw)
In-Reply-To: <u8wwpctnd.fsf@gnu.org>

On Saturday 28 June 2008 22:16:06 Eli Zaretskii wrote:
> > From:  Vladimir Prus <vladimir@codesourcery.com>
> > Date:  Sat, 28 Jun 2008 21:34:57 +0400
> > 
> > Eli Zaretskii wrote:
> > 
> > >> From: Vladimir Prus <vladimir@codesourcery.com>
> > >> Date: Sat, 28 Jun 2008 20:44:14 +0400
> > >> 
> > >> 
> > >> +  if (parse->frame != -1 && !parse->thread == -1)
> > >> +    error ("Cannot specify --frame without --thread");
> > > 
> > > Why is this error message not in _(), while all the rest are?
> > > 
> > > Btw, do we at all want error messages issued by MI commands
> > > translated?  
> > 
> > I think we don't, but I'm not sure.
> > 
> > 
> > > MI commands are invoked by a program, so error messages 
> > > we generate should be understandable by a program, which probably
> > > means they should not be translated.
> > 
> > It's a bit questionable. For example, the error you mention above
> > is clearly a bug in frontend. Presenting a translated version of
> > that message to the user is essentially pointless. On the other
> > hand, "Thread is running", or "Memory not accessible" messages
> > can be helpful for users. Do we need two error messages, maybe?
> 
> Maybe.  Do front ends show the error messages to the user, or do they
> act on them themselves (or both)?

Both, I think. I'd expect that right now, showing the message to the user
is more common than handling it internally -- because it's fairly hard to
guess, from an error message, what is this. For example, KDevelop 3.5, when
operating with pre-6.8 gdb, will handle all errors from -break-insert command 
-- assuming we get an error because the location is in not-yet-loaded shared
library. But, this has the potential to hide real error -- like line number
that is out of range.

It seems like the only solution is to have some set of error codes, which
are never shown to the user, and then have the message string i18ned.

> > >> +      if (strncmp (chp, "--thread", 8) == 0)
> > > 
> > > Please, let's not use literal constants in this context, let's use
> > > sizeof instead.
> > 
> > sizeof? For all I know, sizeof("--thread") will be wrong here.
> 
> Why would it be wrong?

It will give you 9, here.

> > >> +      parse->frame = strtol (chp, &chp, 10);
> > > 
> > > Do we really want to disallow non-decimal numbers here?  What about
> > > hex frame numbers?
> > 
> > Why would frontend want to specify frame level in hex?
> 
> I dunno, does the MI spec mandate decimal here?  If it does, then my
> comment is hereby withdrawn.

The spec does not mandate decimal, or allow hex -- yet. Other commands that
take numbers are also silent, however the code appears to use decimal. For
example, -stack-list-args and friends use atoi -- which is 10-base.

- Volodya


  parent reply	other threads:[~2008-06-29  6:05 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-28 16:54 Vladimir Prus
2008-06-28 17:30 ` Eli Zaretskii
2008-06-28 18:00   ` Vladimir Prus
2008-06-28 18:23     ` Eli Zaretskii
2008-06-28 18:26       ` Marc Khouzam
2008-06-29  6:10       ` Vladimir Prus [this message]
2008-06-29 20:15         ` Eli Zaretskii
2008-07-01  3:53           ` Vladimir Prus
2008-06-30 18:35       ` Michael Snyder
2008-06-30 18:42         ` Daniel Jacobowitz
2008-06-28 18:13 ` Marc Khouzam
2008-06-28 18:26   ` Eli Zaretskii
2008-06-28 18:27     ` Marc Khouzam
2008-06-29  6:08   ` Vladimir Prus
2008-06-29 19:42     ` Eli Zaretskii
2008-06-30  0:09       ` Tom Tromey
2008-06-30  8:39         ` Eli Zaretskii
2008-06-30 18:35         ` Michael Snyder
2008-06-30 19:19           ` Tom Tromey
2008-06-30 20:47             ` Daniel Jacobowitz
2008-07-11 12:50 ` Daniel Jacobowitz
2008-07-12 20:15 ` Ulrich Weigand
2008-07-13  3:54   ` Vladimir Prus
2008-07-15 18:42     ` Ulrich Weigand
2008-07-13  5:45 ` Vladimir Prus

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=200806291005.14181.vladimir@codesourcery.com \
    --to=vladimir@codesourcery.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sources.redhat.com \
    /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