diff options
author | Shahab Vahedi <shahab@synopsys.com> | 2021-06-02 15:30:16 +0300 |
---|---|---|
committer | Claudiu Zissulescu <claziss@synopsys.com> | 2021-06-02 15:32:58 +0300 |
commit | 8f467114435286e4f78b16fc1f5864acf6488fc0 (patch) | |
tree | f2478dacbe828a020cf9d94a39704363b57d85b3 /include | |
parent | f2d4211150abba189c4fcd2f7cf0290161474631 (diff) | |
download | fsf-binutils-gdb-8f467114435286e4f78b16fc1f5864acf6488fc0.zip fsf-binutils-gdb-8f467114435286e4f78b16fc1f5864acf6488fc0.tar.gz fsf-binutils-gdb-8f467114435286e4f78b16fc1f5864acf6488fc0.tar.bz2 |
arc: Construct disassembler options dynamically
The idea of this change is simple: Populate a data structure, namely
"disasm_option_and_arg_t" from "include/dis-asm.h", to encompass the
disassembly options and their possible arguments.
This will make it easier to manage or extend those options by adapting
entries in a data structure, "arc_options". There will be lesser need
to hard-code the options in the code itself. Moreover, ARC GDB will
use this population function, "disassembler_options_arc ()", to enable
the "set disassembler-option" for ARC targets. The gdb change will be
in a separate patch though.
The changes in this patch can be divided into:
1) Introduction of "disassembler_options_arc ()" that will return a
"disasm_option_and_arg_t" structure representing the disassembly
options and their likely arguments.
2) New data type "arc_options_arg_t" and new data "arc_options".
These are the internals for keeping track of options and arguments
entries that can easily be extended.
3) To print the options, the "print_arc_disassembler_options ()" has
been adjusted to use this dynamically built structure instead of having
them hard-coded inside.
To see this in effect, one can look into the output of:
$ ./binutils/objdump --help
...
The following ARC specific disassembler options are...
...
include/ChangeLog:
* dis-asm.h (disassembler_options_arc): New prototype.
opcodes/ChangeLog:
* arc-dis.c (arc_option_arg_t): New enumeration.
(arc_options): New variable.
(disassembler_options_arc): New function.
(print_arc_disassembler_options): Reimplement in terms of
"disassembler_options_arc".
Diffstat (limited to 'include')
-rw-r--r-- | include/ChangeLog | 4 | ||||
-rw-r--r-- | include/dis-asm.h | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/include/ChangeLog b/include/ChangeLog index d1a0485..27c5e29 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,7 @@ +2021-06-02 Shahab Vahedi <shahab@synopsys.com> + + * dis-asm.h (disassembler_options_arc): New prototype. + 2021-05-29 Maciej W. Rozycki <macro@orcam.me.uk> * opcode/mips.h (cpu_is_member): Remove code for MIPSr6 ISA diff --git a/include/dis-asm.h b/include/dis-asm.h index e8b42b0..0b91ab4 100644 --- a/include/dis-asm.h +++ b/include/dis-asm.h @@ -315,6 +315,7 @@ extern void disassemble_init_powerpc (struct disassemble_info *); extern void disassemble_init_s390 (struct disassemble_info *); extern void disassemble_init_wasm32 (struct disassemble_info *); extern void disassemble_init_nds32 (struct disassemble_info *); +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); |