This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, updated] Add support for setting disassembler-options in GDB for POWER, ARM and S390


On 2/13/17 9:52 AM, Yao Qi wrote:
> Peter Bergner <bergner@vnet.ibm.com> writes:
> Function get_arm_regname_num_options is only used in gdb.  Since we've
> have disassembler_options_arm, we can use it in gdb and remove
> get_arm_regname_num_options.
> 
> We use get_arm_regname_num_options in arm-tdep.c,
> 
>    /* Get the number of possible sets of register names defined in opcodes.  */
>    num_disassembly_options = get_arm_regname_num_options ();
> 
> We can get 'num_disassembly_options' by iterating options from
> disassembler_options_arm.
> 
[snip]
> 
> Likewise, we can use disassembler_options_arm in gdb and remove
[snip]
> but we can replace it by disassembler_options_arm instead.

Sure, that should be doable.



>> +# Functions for allowing a target to modify its disassembler options.
>> +v:char *:disassembler_options:::0:0::0:pstring (gdbarch->disassembler_options)
> 
> These options should be modeled as per-architecture data.  We need to
> define a key to access that data dynamically.  grep
> "static struct gdbarch_data *" in *.c.

This is new to me, so can you give me an explicit example?
Can you also explain how its behavior will change but doing
it your way?




>> +v:const disasm_options_t *:disassembler_options_arch:::0:0::0:host_address_to_string (gdbarch->disassembler_options_arch->name)
> 
> disassembler_options_arch is not clear to me, and I feel
> gdbarch_disassembler_options_arch is even worse.  How about renaming it
> to "disassembler_options_supported" or "valid_disassembler_options"?

Heh, looking back on it, yeah, I don't like the name either. :-)
Yours are much better.  I'll probably go with valid_disassembler_options.
Thanks.

Peter






Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]