This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 1/2] Add support for setting disassembler-options in GDB for POWER, ARM and S390
On Tue, Jan 24, 2017 at 09:59:18AM -0600, Peter Bergner wrote:
> On 1/23/17 10:32 PM, Peter Bergner wrote:
> > On 1/23/17 9:36 PM, Alan Modra wrote:
> >>>> This appears to have lost translation of the help strings.
> > [snip]
> >> Yes, I meant the support for language translation.
> >
> > Ok, I see now. How about the following changes to to add _(...)
> > around the option descriptions for s390 and arm (ppc doesn't have any)?
>
> For completeness, here is the full updated patch that keeps the language
> translation.
You're going to hate me, but this still doesn't keep the language
translations. If you regenerate opcodes/po/opcodes.pot you'll see
that lines like
msgid " esa Disassemble in ESA architecture mode\n"
have disappeared without being replaced by anything. I think you need
to wrap your new options[].description with N_() to let gettext know
they should be translated, like this:
static const options_t options[] =
{
{ "esa" , N_("Disassemble in ESA architecture mode") },
{ "zarch", N_("Disassemble in z/Architecture mode") },
{ "insnlength", N_("Print unknown instructions according to "
"length from first two bits") }
};
The same thing needs to be done for regnames description in arm-dis.c.
I also see this arm-dis.c hunk
> @@ -6855,7 +6889,7 @@ the -M switch:\n"));
> fprintf (stream, " reg-names-%s %*c%s\n",
> regnames[i].name,
> (int)(14 - strlen (regnames[i].name)), ' ',
> - regnames[i].description);
> + _(regnames[i].description));
>
> fprintf (stream, " force-thumb Assume all insns are Thumb insns\n");
> fprintf (stream, " no-force-thumb Examine preceding label to determine an insn's type\n\n");
showing missing _() for the last two lines. Bonus points for fixing
them in a way that uses exactly the same translatated strings as you
have in disassembler_options_desc_arm.
The opcodes patch is OK with those changes.
--
Alan Modra
Australia Development Lab, IBM