aboutsummaryrefslogtreecommitdiff
path: root/gdb/source-cache.c
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@redhat.com>2022-06-23 14:49:55 +0100
committerAndrew Burgess <aburgess@redhat.com>2022-10-02 11:58:28 +0100
commit08f406e9a1e3b83d0778493cb219075bbae7bb59 (patch)
tree398a06f209c2011a1166fd604a016ba071da87ac /gdb/source-cache.c
parent924272f2bf5e398412473b14041f84397293c3d3 (diff)
downloadgdb-08f406e9a1e3b83d0778493cb219075bbae7bb59.zip
gdb-08f406e9a1e3b83d0778493cb219075bbae7bb59.tar.gz
gdb-08f406e9a1e3b83d0778493cb219075bbae7bb59.tar.bz2
gdb/mi: new options for -data-disassemble command
Now that the disassembler has two different strategies for laying out the opcode bytes of an instruction (see /r vs /b for the disassemble command), I wanted to add support for this to the MI disassemble command. Currently the -data-disassemble command takes a single 'mode' value, which currently has 6 different values (0 -> 5), 3 of these modes relate to opcode display. So, clearly I should just add an additional 3 modes to handle the new opcode format, right? No, I didn't think that was a great idea either. So, I wonder, could I adjust the -data-disassemble command in a backward compatible way, that would allow GDB to move away from using the mode value altogether? I think we can. In this commit, I propose adding two new options to -data-disassemble, these are: --opcodes none|bytes|display --source Additionally, I will make the mode optional, and default to mode 0 if no mode value is given. Mode 0 is the simplest, no source code, no opcodes disassembly mode. The two new options are only valid for mode 0, if they are used with any other mode then an error is thrown. The --opcodes option can add opcodes to the result, with 'bytes' being equivalent to 'disassemble /b' and 'display' being 'disassemble /r'. The --source option will enable the /s style source code display, this is equivalent to modes 4 and 5. There is no way, using the new command options to get the now deprecated /m style source code display, that is mode 1 and 3. My hope is that new users of the MI will not use the mode at all, and instead will just use the new options to achieve the output they need. Existing MI users can continue to use the mode, and will not need to be updated to use the new options.
Diffstat (limited to 'gdb/source-cache.c')
0 files changed, 0 insertions, 0 deletions