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
- From: Alan Modra <amodra at gmail dot com>
- To: Peter Bergner <bergner at vnet dot ibm dot com>
- Cc: Pedro Alves <palves at redhat dot com>, Eli Zaretskii <eliz at gnu dot org>, nickc at redhat dot com, gdb-patches at sourceware dot org, uweigand at de dot ibm dot com, binutils at sourceware dot org
- Date: Tue, 24 Jan 2017 14:06:25 +1030
- Subject: Re: [PATCH 1/2] Add support for setting disassembler-options in GDB for POWER, ARM and S390
- Authentication-results: sourceware.org; auth=none
- References: <b6037acd-9036-7e69-3350-8da5f0ec981b@vnet.ibm.com> <bdc0c318-4abd-010e-28cf-b654222fe86a@redhat.com> <decc5b05-46eb-2187-5cbd-a7a2a32aaa56@vnet.ibm.com> <83eg28dcjk.fsf@gnu.org> <019eaf5d-9ace-539e-8501-feb3cb0eed6c@vnet.ibm.com> <a1d6f084-4ae2-66a1-3a1b-1a3072b87a0b@redhat.com> <ddaefb9f-9c11-655d-679c-a242bea2c10d@vnet.ibm.com> <20170124015651.GH28669@bubble.grove.modra.org> <b17de542-fbf7-977a-bcc3-e6fd722c9236@vnet.ibm.com>
On Mon, Jan 23, 2017 at 08:39:25PM -0600, Peter Bergner wrote:
> On 1/23/17 7:56 PM, Alan Modra wrote:
> >On Mon, Jan 23, 2017 at 05:34:36PM -0600, Peter Bergner wrote:
> >> The following S/390 specific disassembler options are supported for use\n\
> >> with the -M switch (multiple options should be separated by commas):\n"));
> >>
> >>- fprintf (stream, _(" esa Disassemble in ESA architecture mode\n"));
> >>- fprintf (stream, _(" zarch Disassemble in z/Architecture mode\n"));
> >>- fprintf (stream, _(" insnlength Print unknown instructions according "
> >>- "to length from first two bits\n"));
> >>+ for (i = 0; sizeof (options) / sizeof (options[0]); i++)
> >>+ {
> >>+ unsigned int len = strlen (options[i].name);
> >>+ if (max_len < len)
> >>+ max_len = len;
> >>+ }
> >>+
> >>+ for (i = 0, max_len++; sizeof (options) / sizeof (options[0]); i++)
> >>+ fprintf (stream, " %s%*c %s",
> >>+ options[i].name,
> >>+ (int)(max_len - strlen (options[i].name)), ' ',
> >>+ options[i].description);
> >> }
> >
> >This appears to have lost translation of the help strings.
>
> They're stored in:
>
> diff --git a/opcodes/s390-dis.c b/opcodes/s390-dis.c
> index 328ba2d..6b455aa 100644
> --- a/opcodes/s390-dis.c
> +++ b/opcodes/s390-dis.c
> [snip]
> +static const options_t options[] =
> +{
> + { "esa" , "Disassemble in ESA architecture mode" },
> + { "zarch", "Disassemble in z/Architecture mode" },
> + { "insnlength", "Print unknown instructions according to "
> + "length from first two bits" }
> +};
>
> ...and outputted via the loops above. Or do you mean
> language translation?
Yes, I meant the support for language translation.
--
Alan Modra
Australia Development Lab, IBM