This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: Misc; Was: [RFA]: x86_64 target files
> Andrew Cagney <ac131313@cygnus.com> writes:
>
>
>>>
>>> I can try to take care of this in binutils. You suggest something
>>> like get_arm_regnames in opcodes/arm-dis.c I guess?
>
>>
>> Yes, but having looked at the interface, it isn't the most elegant.
>
>
> Do you have a better idea for an interface?
No.
(Just to be clear. The ``fix'', what ever it is, requires an interface
change to OPCODES. I don't think it is reasonable for me to make the
x86-64 tdep file approval dependant on such an external interface
change. Hence me suggestion to Jiri that a PR recording the problem be
filed and hence the code remain as is.)
I've only got a gut feeling. The x86-64 makes for a second target (and
if we add in the x86m at least a third) that wants a mechanism for
controlling the opcodes assembler. GDB can certainly keep adding hooks
to OPCODES, however, I think it might be time to consider a more generic
interface - that way GDB developers only need to do this once.
Looking at include/dis-asm.h, `struct disassemble_info' already contains
dissassembler_options. A simplistic(1) aproach might be to add the command:
(gdb) set disassembler <blah>
where <blah> was mindlessly assigned to dissassembler_options. There
are plenty of variations on this and probably other better ideas.
Enjoy,
Andrew
(1) And my simplistic suggestion is certainly not as simple as it looks
:-/ : getting GDB to detect / report a invalid option at the time it is
set instead of used; getting GDB to handle this in a multi-arch
environment (an open problem - avoided so far by people using ``set
<arch> <option> ...''); getting GDB to report a list of valid options
in response to:
(gdb) set disassembler
or even (gdb) set disassembler <tab>
hmm ... :-)