cortex-debug icon indicating copy to clipboard operation
cortex-debug copied to clipboard

Can't display dissasembly when not in a known function

Open stevenj opened this issue 7 years ago • 1 comments

If you have some code, and it is NOT in a known function, the debugger displays nothing. It would be nice if it could disassemble the code, starting from the Program Counter, if there is no function to disassemble.

The equivalent gdb command is:

x/32i $pc

Which will disassemble 32 instructions starting at the Program Counter. The 32 is arbitrary, it can be any reasonable number, as long as it's enough to get some context.

Then when you step, it doesn't need to regenerate the disassembly until you are outside this area.

Improved version: It would be possible to disassemble before the current $PC, but that would require a little extra logic, because it's not possible to know if $pc-32 is an instruction boundary or not. So one would need to step back, disassemble, and if the current PC does not align with a disassembled PC, step by 2 bytes, and try again.

stevenj avatar Jun 09 '18 03:06 stevenj

Will have a look and see what I can do about this.

Marus avatar Jun 11 '18 00:06 Marus