This is the mail archive of the
mailing list for the GDB project.
Re: [PATCH, RFC] Add support for choosing disassembler cpu in GDB for POWER.
On 10/06/2016 08:26 PM, Peter Bergner wrote:
>> But if we could have a single generic command, that'd be of course better.
>> It's worth it to think about how it'd work at the user-interface level,
>> even if we don't make any other arch use it right away.
> I'm not sure what you mean by a generic command,
A command that works for all architectures, like your original
"set disassembler-cpu" seemingly would be (ignoring implementation
details). Maybe "set disassembler-cpu" could be an alias for
"set $current_arch disassembler-cpu". GDB would then only need to store
a disassemble option string for each possible arch, and the alias would just
need to map the current arch's cpu to the right option string variable.
All the information to build this should be in opcodes, I think. Even
for "help show disassembler-cpu", it should be possible for gdb to ask
opcodes to print a description of each possible option,
since "objdump --help" does it. Bonus points for hooking that to
a completer for "set disassembler-cpu <tab>". :-)
BTW, AFAICS, objdump's -M isn't really only about "cpu".
"objdump --help" on an --enable-targets=all build of binutils
shows -M options that are not cpu options. "set disassembler-options"
would probably be a better name for this.