Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Nick Roberts <nickrob@snap.net.nz>
To: Daniel Jacobowitz <drow@false.org>
Cc: Bjarke Viksoe <bviksoe@hotmail.com>, gdb@sourceware.org
Subject: Re: MI error msgs and localization
Date: Wed, 15 Feb 2006 01:48:00 -0000	[thread overview]
Message-ID: <17394.34829.877266.50785@kahikatea.snap.net.nz> (raw)
In-Reply-To: <20060214233209.GA5046@nevyn.them.org>

 > > You wouldn't have to remember them, thay're for use by the front-end, not
 > > the user.  In any case the console log stream gets printed alongside,
 > > which should be self-explanatory.  How would you arrange for the type
 > > message to be printed?  Would you give error a second string argument?
 > > It has over 1200 calls.
 > > 
 > >  > We have to be careful what error messages get identifiers, though.
 > >  > Please don't anybody go through the source indiscriminately adding
 > >  > them.  Many errors will still be subject to change even if you tack
 > >  > permanent identifiers on them.
 > > 
 > > All calls to error could be given a dummy argument (0, if numbers are
 > > used), and replaced with a real one only in thoses cases when a need
 > > arises.
 > 
 > You've answered your own question.  The calls which need to be changed
 > could be changed to call something other than error() itself.

That's not quite what I said but it's a better idea as fewer changes need be
made.  Better still might be to use a global variable, perhaps
mi_error_message in mi-main.c could be used.  How about something like the
patch below (in mi_execute_command) to be used like this:

  mi_error_message = xstrprintf ("no-debugging-symbols");
  error(_("No debugging symbols found");

to give:

  &"No debugging symbols found\n"
  ^error,msg="no-debugging-symbols"

I've not used the previous example ("Unrecognized option"), as it comes from
getopt_long_only and not error (however, I think all of Bjarke's other
examples were from error).

WDYT?

Nick


*** mi-main.c	30 Jan 2006 09:17:56 +1300	1.83
--- mi-main.c	15 Feb 2006 14:31:38 +1300	
***************
*** 1171,1177 ****
  	     somewhere.  */
  	  fputs_unfiltered (command->token, raw_stdout);
  	  fputs_unfiltered ("^error,msg=\"", raw_stdout);
! 	  fputstr_unfiltered (result.message, '"', raw_stdout);
  	  fputs_unfiltered ("\"\n", raw_stdout);
  	  mi_out_rewind (uiout);
  	}
--- 1171,1183 ----
  	     somewhere.  */
  	  fputs_unfiltered (command->token, raw_stdout);
  	  fputs_unfiltered ("^error,msg=\"", raw_stdout);
! 	  if (mi_error_message)
! 	    {
! 	      fputstr_unfiltered (mi_error_message, '"', raw_stdout);
! 	      xfree (mi_error_message);
! 	    }
! 	  else
! 	    fputstr_unfiltered (result.message, '"', raw_stdout);
  	  fputs_unfiltered ("\"\n", raw_stdout);
  	  mi_out_rewind (uiout);
  	}


  reply	other threads:[~2006-02-15  1:48 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 [this message]
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

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=17394.34829.877266.50785@kahikatea.snap.net.nz \
    --to=nickrob@snap.net.nz \
    --cc=bviksoe@hotmail.com \
    --cc=drow@false.org \
    --cc=gdb@sourceware.org \
    /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