From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id C0AbAVSyFmNqMjQAWB0awg (envelope-from ) for ; Mon, 05 Sep 2022 22:37:08 -0400 Received: by simark.ca (Postfix, from userid 112) id E74661E4A7; Mon, 5 Sep 2022 22:37:07 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=JwK555K4; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 1E3F21E222 for ; Mon, 5 Sep 2022 22:37:01 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 613253851150 for ; Tue, 6 Sep 2022 02:37:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 613253851150 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1662431820; bh=PFe/W+pQWLrFw70MhCVYOF+0At+WOcl5Xxnt/UhfTr0=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=JwK555K4aM4Xcw7rJVRB/XxVEzzu5s2c3G4WNpLeUc/rRUZOjAXScYTZ5EF06Wucm atSTtukmnX8omuwn0PTZiGOEeJzLj/Y985ceOUchPOYWLtQuJrSaogh5ol1LD2dOsF eg0T1KUqA7LrDTxCcELyhaJqTTV5IoypIa6Wh/CY= Received: from mail-sender-0.a4lg.com (mail-sender.a4lg.com [153.120.152.154]) by sourceware.org (Postfix) with ESMTPS id 3D9723858C2F; Tue, 6 Sep 2022 02:36:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3D9723858C2F Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail-sender-0.a4lg.com (Postfix) with ESMTPSA id 68458300089; Tue, 6 Sep 2022 02:36:32 +0000 (UTC) Message-ID: <70b4912d-99a0-8bb4-60e8-c0239aa23b7a@irq.a4lg.com> Date: Tue, 6 Sep 2022 11:36:30 +0900 Mime-Version: 1.0 Subject: Re: [PATCH v2 1/2] opcodes: Add non-enum disassembler options Content-Language: en-US To: Nick Clifton , Andrew Burgess References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Tsukasa OI via Gdb-patches Reply-To: Tsukasa OI Cc: binutils@sourceware.org, gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" PATCH v2 1/2 is committed as a combination of: - Changes from PATCH v1 1/2 (that is approved) - Obvious copy-editing on the commit message (no code changes) Under the "write after approval" access to the Binutils project. This is my very first commit by myself (as a new committer). Thanks, Nick! Technically, it's not impossible to push 2/2 myself but this is definitely not Binutils and GDB should go. Andrew, if you don't mind, could you push the PATCH v2 2/2 for me? Thanks, Tsukasa On 2022/09/04 17:03, Tsukasa OI wrote: > This is paired with "gdb: Add non-enum disassembler options". > > There is a portable mechanism for disassembler options and used on some > architectures: > > - ARC > - Arm > - MIPS > - PowerPC > - RISC-V > - S/390 > > However, it only supports following forms: > > - [NAME] > - [NAME]=[ENUM_VALUE] > > Valid values for [ENUM_VALUE] must be predefined in > disasm_option_arg_t.values. For instance, for -M cpu=[CPU] in ARC > architecture, opcodes/arc-dis.c builds valid CPU model list from > include/elf/arc-cpu.def. > > In this commit, it adds following format: > > - [NAME]=[ARBITRARY_VALUE] (cannot contain "," though) > > This is identified by NULL value of disasm_option_arg_t.values > (normally, this is a non-NULL pointer to a NULL-terminated list). > > include/ChangeLog: > > * dis-asm.h (disasm_option_arg_t): Update comment of values > to allow non-enum disassembler options. > > opcodes/ChangeLog: > > * riscv-dis.c (print_riscv_disassembler_options): Support > non-enum disassembler options on printing disassembler help. > * arc-dis.c (print_arc_disassembler_options): Likewise. > * mips-dis.c (print_mips_disassembler_options): Likewise. > --- > include/dis-asm.h | 3 ++- > opcodes/arc-dis.c | 2 ++ > opcodes/mips-dis.c | 2 ++ > opcodes/riscv-dis.c | 2 ++ > 4 files changed, 8 insertions(+), 1 deletion(-) > > diff --git a/include/dis-asm.h b/include/dis-asm.h > index f1a83dc84e5..4921c040710 100644 > --- a/include/dis-asm.h > +++ b/include/dis-asm.h > @@ -318,7 +318,8 @@ typedef struct > /* Option argument name to use in descriptions. */ > const char *name; > > - /* Vector of acceptable option argument values, NULL-terminated. */ > + /* Vector of acceptable option argument values, NULL-terminated. > + NULL if any values are accepted. */ > const char **values; > } disasm_option_arg_t; > > diff --git a/opcodes/arc-dis.c b/opcodes/arc-dis.c > index 3490bad4f66..c8dc525f64d 100644 > --- a/opcodes/arc-dis.c > +++ b/opcodes/arc-dis.c > @@ -1611,6 +1611,8 @@ print_arc_disassembler_options (FILE *stream) > for (i = 0; args[i].name != NULL; ++i) > { > size_t len = 3; > + if (args[i].values == NULL) > + continue; > fprintf (stream, _("\n\ > For the options above, the following values are supported for \"%s\":\n "), > args[i].name); > diff --git a/opcodes/mips-dis.c b/opcodes/mips-dis.c > index 9db604ffb39..faeebccfc3b 100644 > --- a/opcodes/mips-dis.c > +++ b/opcodes/mips-dis.c > @@ -2809,6 +2809,8 @@ with the -M switch (multiple options should be separated by commas):\n\n")); > > for (i = 0; args[i].name != NULL; i++) > { > + if (args[i].values == NULL) > + continue; > fprintf (stream, _("\n\ > For the options above, the following values are supported for \"%s\":\n "), > args[i].name); > diff --git a/opcodes/riscv-dis.c b/opcodes/riscv-dis.c > index 160cc40f865..7ae6e709290 100644 > --- a/opcodes/riscv-dis.c > +++ b/opcodes/riscv-dis.c > @@ -1195,6 +1195,8 @@ with the -M switch (multiple options should be separated by commas):\n")); > > for (i = 0; args[i].name != NULL; i++) > { > + if (args[i].values == NULL) > + continue; > fprintf (stream, _("\n\ > For the options above, the following values are supported for \"%s\":\n "), > args[i].name);