diff options
author | Andrew Burgess <aburgess@redhat.com> | 2021-09-28 22:11:57 +0100 |
---|---|---|
committer | Andrew Burgess <aburgess@redhat.com> | 2021-11-26 10:18:59 +0000 |
commit | 61a5375b842e24b6f492efda7eb213b6e6cf677d (patch) | |
tree | 5414919612452a1d8f658b0ea6cffa1c5a97043a /gdb/riscv-tdep.c | |
parent | 3a337a86d9d273b5da57b1cd8ecec4baa7e95e33 (diff) | |
download | gdb-61a5375b842e24b6f492efda7eb213b6e6cf677d.zip gdb-61a5375b842e24b6f492efda7eb213b6e6cf677d.tar.gz gdb-61a5375b842e24b6f492efda7eb213b6e6cf677d.tar.bz2 |
gdb: add risc-v disassembler options support
This commit adds support for RISC-V disassembler options to GDB. This
commit is based on this patch which was never committed:
https://sourceware.org/pipermail/binutils/2021-January/114944.html
All of the binutils refactoring has been moved to a separate, earlier,
commit, so this commit is pretty straight forward, just registering
the required gdbarch hooks.
Co-authored-by: Simon Cook <simon.cook@embecosm.com>
Diffstat (limited to 'gdb/riscv-tdep.c')
-rw-r--r-- | gdb/riscv-tdep.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gdb/riscv-tdep.c b/gdb/riscv-tdep.c index 94dad41..4d87a89 100644 --- a/gdb/riscv-tdep.c +++ b/gdb/riscv-tdep.c @@ -101,6 +101,9 @@ static const char *riscv_feature_name_fpu = "org.gnu.gdb.riscv.fpu"; static const char *riscv_feature_name_virtual = "org.gnu.gdb.riscv.virtual"; static const char *riscv_feature_name_vector = "org.gnu.gdb.riscv.vector"; +/* The current set of options to be passed to the disassembler. */ +static char *riscv_disassembler_options; + /* Cached information about a frame. */ struct riscv_unwind_cache @@ -3803,6 +3806,11 @@ riscv_gdbarch_init (struct gdbarch_info info, set_gdbarch_gcc_target_options (gdbarch, riscv_gcc_target_options); set_gdbarch_gnu_triplet_regexp (gdbarch, riscv_gnu_triplet_regexp); + /* Disassembler options support. */ + set_gdbarch_valid_disassembler_options (gdbarch, + disassembler_options_riscv ()); + set_gdbarch_disassembler_options (gdbarch, &riscv_disassembler_options); + /* Hook in OS ABI-specific overrides, if they have been registered. */ gdbarch_init_osabi (info, gdbarch); |