From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15540 invoked by alias); 18 Mar 2011 10:23:10 -0000 Received: (qmail 15530 invoked by uid 22791); 18 Mar 2011 10:23:09 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00,MSGID_MULTIPLE_AT X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.152) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 18 Mar 2011 10:23:04 +0000 Received: from md1.u-strasbg.fr (md1.u-strasbg.fr [IPv6:2001:660:2402::186]) by mailhost.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id p2IAN03K093619 for ; Fri, 18 Mar 2011 11:23:01 +0100 (CET) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from mailserver.u-strasbg.fr (ms7.u-strasbg.fr [130.79.204.16]) by md1.u-strasbg.fr (8.14.4/jtpda-5.5pre1) with ESMTP id p2IAN05M008780 for ; Fri, 18 Mar 2011 11:23:00 +0100 (CET) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from E6510Muller (gw-ics.u-strasbg.fr [130.79.210.225]) (user=mullerp mech=LOGIN) by mailserver.u-strasbg.fr (8.14.4/jtpda-5.5pre1) with ESMTP id p2IAMxUw042460 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) for ; Fri, 18 Mar 2011 11:22:59 +0100 (CET) (envelope-from pierre.muller@ics-cnrs.unistra.fr) From: "Pierre Muller" To: Subject: [RFC] Internationalization markup of messages and common code Date: Fri, 18 Mar 2011 13:07:00 -0000 Message-ID: <008601cbe556$76560c50$630224f0$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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: 2011-03/txt/msg00910.txt.bz2 As I recently added the gettext category to standard ARI output, I found out that common/signals.c has calls to error and warning functions without _() markups. Trying to add them, I realized that the problem was that gdbserver did not use those markups. This leads to a conflict between gdbserver code that has no internalization and gdb that requires it. The following patch adds a no-op underscore macro to server.h in gdbserver sub-directory, allowing thus to use _ macro in any new common code (I still have some code of this kind to prepare for submission...). I have no idea if this is the correct answer to the problem I raised above, but for me it seemed a simple answer. All opinions welcome, Pierre Muller GDB pascal language maintainer PS: This is an illustration of the multiple ChangeLog problem, this is really a unique patch, but with two independent entries, this link will be lost.. Should I add a cross-reference to the other ChangeLog here? Proposed patch: gdb ChangeLog entry: 2011-03-18 Pierre Muller * common/signals.c (target_signal_from_host): Add _ markup to error function call message. (target_signal_to_host): Add _ markup and remove trailing new line from warning call message. (target_signal_from_command): Add _ markup to error function call message. gdb/gdbserver ChangeLog entry: 2011-03-18 Pierre Muller * server.h (Macro _): Define it if not available. Index: src/gdb/common/signals.c =================================================================== RCS file: /cvs/src/src/gdb/common/signals.c,v retrieving revision 1.6 diff -u -p -r1.6 signals.c --- src/gdb/common/signals.c 6 Jan 2011 00:57:02 -0000 1.6 +++ src/gdb/common/signals.c 18 Mar 2011 09:48:37 -0000 @@ -349,8 +349,8 @@ target_signal_from_host (int hostsig) return (enum target_signal) (hostsig - 64 + (int) TARGET_SIGNAL_REALTIME_64); else - error ("GDB bug: target.c (target_signal_from_host): " - "unrecognized real-time signal"); + error (_("GDB bug: target.c (target_signal_from_host): " + "unrecognized real-time signal")); } #endif @@ -644,7 +644,7 @@ target_signal_to_host (enum target_signa { /* The user might be trying to do "signal SIGSAK" where this system doesn't have SIGSAK. */ - warning ("Signal %s does not exist on this system.\n", + warning (_("Signal %s does not exist on this system."), target_signal_to_name (oursig)); return 0; } @@ -667,8 +667,8 @@ target_signal_from_command (int num) { if (num >= 1 && num <= 15) return (enum target_signal) num; - error ("Only signals 1-15 are valid as numeric signals.\n\ -Use \"info signals\" for a list of symbolic signals."); + error (_("Only signals 1-15 are valid as numeric signals.\n\ +Use \"info signals\" for a list of symbolic signals.")); } extern initialize_file_ftype _initialize_signals; /* -Wmissing-prototype */ Index: src/gdb/gdbserver/server.h =================================================================== RCS file: /cvs/src/src/gdb/gdbserver/server.h,v retrieving revision 1.81 diff -u -p -r1.81 server.h --- src/gdb/gdbserver/server.h 14 Feb 2011 11:13:12 -0000 1.81 +++ src/gdb/gdbserver/server.h 18 Mar 2011 09:48:37 -0000 @@ -96,6 +96,12 @@ int vsnprintf(char *str, size_t size, co #endif #endif +/* Define underscore macro, if not available, to be able to use it inside + code shared with gdb in common directory. */ +#ifndef _ +#define _(String) (String) +#endif + /* A type used for binary buffers. */ typedef unsigned char gdb_byte;