From: "Pierre Muller" <pierre.muller@ics-cnrs.unistra.fr>
To: <gdb-patches@sourceware.org>
Subject: [RFC] Internationalization markup of messages and common code
Date: Fri, 18 Mar 2011 13:07:00 -0000 [thread overview]
Message-ID: <008601cbe556$76560c50$630224f0$@muller@ics-cnrs.unistra.fr> (raw)
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 <muller@ics.u-strasbg.fr>
* 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 <muller@ics.u-strasbg.fr>
* 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;
next reply other threads:[~2011-03-18 10:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-18 13:07 Pierre Muller [this message]
2011-03-18 13:12 ` Pedro Alves
2011-03-18 13:31 ` Pierre Muller
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='008601cbe556$76560c50$630224f0$@muller@ics-cnrs.unistra.fr' \
--to=pierre.muller@ics-cnrs.unistra.fr \
--cc=gdb-patches@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