From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2699 invoked by alias); 27 May 2008 18:58:53 -0000 Received: (qmail 2681 invoked by uid 22791); 27 May 2008 18:58:52 -0000 X-Spam-Check-By: sourceware.org Received: from mtaout4.012.net.il (HELO mtaout4.012.net.il) (84.95.2.10) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 27 May 2008 18:58:33 +0000 Received: from HOME-C4E4A596F7 ([83.130.219.40]) by i_mtaout4.012.net.il (HyperSendmail v2004.12) with ESMTPA id <0K1J001QHK1549C1@i_mtaout4.012.net.il> for gdb-patches@sources.redhat.com; Tue, 27 May 2008 22:12:42 +0300 (IDT) Date: Tue, 27 May 2008 23:25:00 -0000 From: Eli Zaretskii Subject: Re: [patch] catchpoints bring output in-line with breakpoints output In-reply-to: X-012-Sender: halo1@inter.net.il To: Aleksandar Ristovski Cc: gdb-patches@sources.redhat.com Reply-to: Eli Zaretskii Message-id: References: X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-05/txt/msg00717.txt.bz2 > From: Aleksandar Ristovski > 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.