Message ID | 6962ef25-9722-f0f0-d0a2-209b10761311@vnet.ibm.com |
---|---|
State | New, archived |
Headers |
Received: (qmail 124220 invoked by alias); 24 Jan 2017 04:32:54 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <gdb-patches.sourceware.org> List-Unsubscribe: <mailto:gdb-patches-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:gdb-patches-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 124197 invoked by uid 89); 24 Jan 2017 04:32:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.1 required=5.0 tests=AWL, BAYES_50, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=Examine, regnames, insn's, **desc X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 24 Jan 2017 04:32:51 +0000 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v0O4SfU0019481 for <gdb-patches@sourceware.org>; Mon, 23 Jan 2017 23:32:50 -0500 Received: from e18.ny.us.ibm.com (e18.ny.us.ibm.com [129.33.205.208]) by mx0a-001b2d01.pphosted.com with ESMTP id 285ee51pnr-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for <gdb-patches@sourceware.org>; Mon, 23 Jan 2017 23:32:50 -0500 Received: from localhost by e18.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for <gdb-patches@sourceware.org> from <bergner@vnet.ibm.com>; Mon, 23 Jan 2017 23:32:49 -0500 Received: from d01dlp02.pok.ibm.com (9.56.250.167) by e18.ny.us.ibm.com (146.89.104.205) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 23 Jan 2017 23:32:46 -0500 Received: from b01cxnp22034.gho.pok.ibm.com (b01cxnp22034.gho.pok.ibm.com [9.57.198.24]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id D648E6E803C; Mon, 23 Jan 2017 23:32:18 -0500 (EST) Received: from b01ledav001.gho.pok.ibm.com (b01ledav001.gho.pok.ibm.com [9.57.199.106]) by b01cxnp22034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v0O4Wkdx42074348; Tue, 24 Jan 2017 04:32:46 GMT Received: from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 429A52803D; Mon, 23 Jan 2017 23:32:46 -0500 (EST) Received: from otta.local (unknown [9.80.203.250]) by b01ledav001.gho.pok.ibm.com (Postfix) with ESMTP id AC0C12803A; Mon, 23 Jan 2017 23:32:45 -0500 (EST) Subject: Re: [PATCH 1/2] Add support for setting disassembler-options in GDB for POWER, ARM and S390 To: Alan Modra <amodra@gmail.com> 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> <20170124033625.GI28669@bubble.grove.modra.org> Cc: Pedro Alves <palves@redhat.com>, Eli Zaretskii <eliz@gnu.org>, nickc@redhat.com, gdb-patches@sourceware.org, uweigand@de.ibm.com, binutils@sourceware.org From: Peter Bergner <bergner@vnet.ibm.com> Date: Mon, 23 Jan 2017 22:32:45 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <20170124033625.GI28669@bubble.grove.modra.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17012404-0044-0000-0000-0000025BBDCB X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006487; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000200; SDB=6.00811836; UDB=6.00395856; IPR=6.00589253; BA=6.00005084; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00014020; XFM=3.00000011; UTC=2017-01-24 04:32:48 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17012404-0045-0000-0000-00000688C009 Message-Id: <6962ef25-9722-f0f0-d0a2-209b10761311@vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-01-24_02:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1701240045 X-IsSubscribed: yes |
Commit Message
Peter Bergner
Jan. 24, 2017, 4:32 a.m. UTC
On 1/23/17 9:36 PM, Alan Modra wrote: > 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. [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)? Peter diff --git a/opcodes/arm-dis.c b/opcodes/arm-dis.c index 2987403..b5fd1e0 100644 --- a/opcodes/arm-dis.c +++ b/opcodes/arm-dis.c get_arm_regnames (int option, const char **setname, const char **setdescription, const char *const **register_names) { *setname = regnames[option].name; - *setdescription = regnames[option].description; + *setdescription = _(regnames[option].description); *register_names = regnames[option].reg_names; return 16; } @@ -6126,7 +6120,7 @@ arm_symbol_is_valid (asymbol * sym, +const char ** +disassembler_options_desc_arm (void) +{ + static const char **desc = NULL; + + if (desc == NULL) + { + size_t i; + size_t num_desc = NUM_ARM_REGNAMES + 2; + desc = XNEWVEC (const char *, num_desc + 1); + for (i = 0; i < NUM_ARM_REGNAMES; i++) + desc[i] = _(regnames[i].description); + desc[i++] = _("Assume all insns are Thumb insns"); + desc[i++] = _("Examine preceding label to determine an insn's type"); + desc[i] = NULL; + } + + return desc; +} + @@ -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");
diff --git a/opcodes/s390-dis.c b/opcodes/s390-dis.c index 328ba2d..cbae7be 100644 --- a/opcodes/s390-dis.c +++ b/opcodes/s390-dis.c @@ -360,15 +369,58 @@ print_insn_s390 (bfd_vma memaddr, struct disassemble_info *info) +const char ** +disassembler_options_desc_s390 (void) +{ + static const char **desc = NULL; + + if (desc == NULL) + { + size_t i, num_options = sizeof (options) / sizeof (options[0]); + desc = XNEWVEC (const char *, num_options + 1); + for (i = 0; i < num_options; i++) + desc[i] = _(options[i].description); + desc[i] = NULL; + } + + return desc; +} + 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)); }