aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@redhat.com>2021-09-28 22:11:42 +0100
committerAndrew Burgess <aburgess@redhat.com>2021-11-26 10:18:35 +0000
commit3a337a86d9d273b5da57b1cd8ecec4baa7e95e33 (patch)
treeb7b3022634d0a3bc5e1c6b12bbeed1c8ac337555 /include
parent4780e5e4933a2497a5aecc4ceabbbb8e82aaf822 (diff)
downloadgdb-3a337a86d9d273b5da57b1cd8ecec4baa7e95e33.zip
gdb-3a337a86d9d273b5da57b1cd8ecec4baa7e95e33.tar.gz
gdb-3a337a86d9d273b5da57b1cd8ecec4baa7e95e33.tar.bz2
opcodes/riscv: add disassembler options support to libopcodes
In preparation for the next commit, which will add GDB support for RISC-V disassembler options, this commit restructures how the disassembler options are managed within libopcodes. The implementation provided here is based on this mailing list patch which was never committed: https://sourceware.org/pipermail/binutils/2021-January/114944.html which in turn took inspiration from the MIPS implementation of the same feature. The biggest changes from the original mailing list post are: 1. The GDB changes have been split into a separate patch, and 2. The `riscv_option_args_privspec` variable, which held the valid priv-spec values is now gone, instead we use the `riscv_priv_specs` array from bfd/cpu-riscv.c instead. Co-authored-by: Simon Cook <simon.cook@embecosm.com> include/ChangeLog: * dis-asm.h (disassembler_options_riscv): Declare. opcodes/ChangeLog: * riscv-dis.c (enum riscv_option_arg_t): New enum typedef. (riscv_options): New static global. (disassembler_options_riscv): New function. (print_riscv_disassembler_options): Rewrite to use disassembler_options_riscv.
Diffstat (limited to 'include')
-rw-r--r--include/ChangeLog5
-rw-r--r--include/dis-asm.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/include/ChangeLog b/include/ChangeLog
index 5248323..c0486e9 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,8 @@
+2021-11-25 Andrew Burgess <aburgess@redhat.com>
+ Simon Cook <simon.cook@embecosm.com>
+
+ * dis-asm.h (disassembler_options_riscv): Declare.
+
2021-11-16 Fangrui Song <maskray@google.com>
* elf/common.h (DT_ENCODING): Bump to 38.
diff --git a/include/dis-asm.h b/include/dis-asm.h
index c0bc1d5..81cefb9 100644
--- a/include/dis-asm.h
+++ b/include/dis-asm.h
@@ -320,6 +320,7 @@ extern const disasm_options_and_args_t *disassembler_options_arc (void);
extern const disasm_options_and_args_t *disassembler_options_arm (void);
extern const disasm_options_and_args_t *disassembler_options_mips (void);
extern const disasm_options_and_args_t *disassembler_options_powerpc (void);
+extern const disasm_options_and_args_t *disassembler_options_riscv (void);
extern const disasm_options_and_args_t *disassembler_options_s390 (void);
/* Fetch the disassembler for a given architecture ARC, endianess (big