From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-sender-0.a4lg.com (mail-sender-0.a4lg.com [IPv6:2401:2500:203:30b:4000:6bfe:4757:0]) by sourceware.org (Postfix) with ESMTPS id 1FA473858431 for ; Sun, 6 Feb 2022 02:10:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1FA473858431 From: Tsukasa OI To: Tsukasa OI Cc: binutils@sourceware.org Subject: [RFC PATCH v2 0/2] gdb, opcodes: Add isa disassembler option to RISC-V Date: Sun, 6 Feb 2022 11:10:35 +0900 Message-Id: In-Reply-To: References: Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TO_EQ_FM_DIRECT_MX, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Feb 2022 02:10:55 -0000 *** NOTE *** PATCH 1 contains non-RISC-V (GDB-related) changes. This patchset adds support for isa=ISA diassembler option to RISC-V. - objdump: -M isa=rv[32|64]... - gdb: set disassembler-options isa=rv[32|64]... This patchset is version 2. Version 1 is here: My development branch on GitHub: [Changes between RFC PATCH v1 and RFC PATCH v2] The only functional change in the RFC PATCH v2 is that we reset `xlen' variable to `0' before parsing ISA string. It has no effect on objdump but on GDB, it stops preserving last XLEN value before setting invalid ISA string (not starting with "rv32" or "rv64"). Rest of the changes are editorial. My language got broken while writing v1 but I think most of them are fixed in v2. Also, most "-M isa" (objdump-only) references are replaced with just "isa" to indicate both objdump and GDB options. Renamed `xlen_set_by_option' to `xlen_by_isa' for clarity (meaning XLEN set by "ISA string" option). Tsukasa OI (2): gdb, opcodes: Add non-enum disassembler options RISC-V: Add isa disassembler option gdb/disasm.c | 4 ++++ include/dis-asm.h | 3 ++- opcodes/arc-dis.c | 2 ++ opcodes/mips-dis.c | 2 ++ opcodes/riscv-dis.c | 35 ++++++++++++++++++++++++++++------- 5 files changed, 38 insertions(+), 8 deletions(-) base-commit: 94e57f287f96af6af97dd086e4a04ddf55b7cf60 -- 2.32.0