RISC-V: Add missing disassembler option max

The flag already exists but it's not been exposed to user.

Signed-off-by: Marek Pikuła <m.pikula@partner.samsung.com>
This commit is contained in:
Marek Pikuła
2025-04-01 17:43:16 +02:00
committed by Nelson Chu
parent e7092c0390
commit 88891208c3
2 changed files with 13 additions and 1 deletions

View File

@@ -2701,6 +2701,14 @@ but the result again may not be as you expect.
For RISC-V, the following options are supported: For RISC-V, the following options are supported:
@table @code @table @code
@item max
Disassemble without checking architecture string. This is a best effort mode, so
for overlapping ISA extensions the first match (possibly incorrect in a given
context) will be used to decode the instruction. It's useful, if the ELF file
doesn't expose ISA string, preventing automatic ISA subset deduction, and the
default fallback ISA string (@code{rv64gc}) doesn't cover all instructions in
the binary.
@item numeric @item numeric
Print numeric register names, rather than ABI names (e.g., print @code{x2} Print numeric register names, rather than ABI names (e.g., print @code{x2}
instead of @code{sp}). instead of @code{sp}).

View File

@@ -69,7 +69,7 @@ struct riscv_private_data
const char (*riscv_fpr_names)[NRC]; const char (*riscv_fpr_names)[NRC];
/* If set, disassemble as most general instruction. */ /* If set, disassemble as most general instruction. */
bool no_aliases; bool no_aliases;
/* If set, disassemble without checking architectire string, just like what /* If set, disassemble without checking architecture string, just like what
we did at the beginning. */ we did at the beginning. */
bool all_ext; bool all_ext;
}; };
@@ -83,6 +83,7 @@ set_default_riscv_dis_options (struct disassemble_info *info)
pd->riscv_gpr_names = riscv_gpr_names_abi; pd->riscv_gpr_names = riscv_gpr_names_abi;
pd->riscv_fpr_names = riscv_fpr_names_abi; pd->riscv_fpr_names = riscv_fpr_names_abi;
pd->no_aliases = false; pd->no_aliases = false;
pd->all_ext = false;
} }
/* Parse RISC-V disassembler option (without arguments). */ /* Parse RISC-V disassembler option (without arguments). */
@@ -1580,6 +1581,9 @@ static struct
riscv_option_arg_t arg; riscv_option_arg_t arg;
} riscv_options[] = } riscv_options[] =
{ {
{ "max",
N_("Disassemble without checking architecture string."),
RISCV_OPTION_ARG_NONE },
{ "numeric", { "numeric",
N_("Print numeric register names, rather than ABI names."), N_("Print numeric register names, rather than ABI names."),
RISCV_OPTION_ARG_NONE }, RISCV_OPTION_ARG_NONE },