GDB real-time protected mode, on-the-fly disassembled

I am trying to debug part of the MBR code, with some context switch in it. I have an asm layout configured by default with 16-bit disassembled instructions.

My problem arises when I create a context for protected mode, in which case the instructions in the asm window will go blank / meaningless (the processor will still execute the correct ofc instructions).

I know about the set architecture i8086/i386 team. But they only work before I connect to the virtual machine. I can’t change the architecture on the fly.

Note. I would like to make context switches back and forth, so I need to see the correct instructions.

In general, is it possible to switch the architecture and update instructions in asm windows? (with some weird team? weird workaroud?)

+4
source share
1 answer

Well, I understood myself at the end.

No magic is required ...

First you need to configure the architecture:

 set arch i8086 / set arch i386 (...) 

then the disassemble command should be used in a specific range of functions / addresses:

 disassemble 0x7c00, 100 
+1
source

All Articles