This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] catchpoints bring output in-line with breakpoints output


> From:  Aleksandar Ristovski <aristovski@qnx.com>
> Date:  Tue, 27 May 2008 14:43:10 -0400
> 
> > This patch brings catchpoint output in line with breakpoints output:

Thanks!  I have one comment on your changes:

>  static enum print_stop_action
>  print_exception_catchpoint (struct breakpoint *b)
>  {
> +  int bp_temp;
> +  char msg[160];
> +  const char * msgspec;
> +  const char msgfmt[] = "\n%s %d (exception %s)\n";

This is not a good idea, because it defeats translation.  For
starters, this format string will not be caught by xgettext and won't
be in the message catalog.  Moreover, ...

> +  sprintf (msg, msgfmt, 
> +	   bp_temp ? "Temporary catchpoint" : "Catchpoint", 
> +	   b->number, msgspec);

... this kind of assembly of a sentence on the flight is bad, because
it doesn't leave the translators an opportunity to see a complete
phrase, and thus the concatenation of 2 fragments translated
independently might well produce a sentence that is invalid in the
target language.

Please instead use the technique you used in another portion of the patch:

> +    printf_filtered (bp_temp ? _("Temporary catchpoint %d (throw)")
> +			     : _("Catchpoint %d (throw)"), b->number);
>    else
> -    printf_filtered (_("Catchpoint %d (catch)"), b->number);
> +    printf_filtered (bp_temp ? _("Temporary catchpoint %d (catch)")
> +			     : _("Catchpoint %d (catch)"), b->number);

Here, the complete phrases are used, and the small waste of space for
repeating the common part is well worth the gain.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]