4

I'm trying to debug a piece of MBR code, with some context switch in it. I have the asm layout set up by default with 16bit disassambled instructions.

My problem appears when I make a context to protected mode, in wich case the instructions in the asm window will go nuts / senseless (the processor will still run the correct instructions ofc).

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

Note: I'd like to make context switches back & forth, so I need to see the correct instructions.

All in all is it possible to switch the architecture & refresh the instructions in the asm windows? (with some strange command? strange workaroud?)

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
lerosQ
  • 250
  • 3
  • 11
  • I don't think it matters ... It could be a simple exe file too. But I use vmware workstation for both the mbr & for the ubuntu system. (I debug the mbr code though the ubuntu) – lerosQ Jan 09 '13 at 14:49

1 Answers1

3

Okay, figured out myself at the end.

No magic is needed ...

The architecture needs to be set up first:

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

then the disassemble command should be used on a specific function/address range:

disassemble 0x7c00, +100
zhenguoli
  • 2,268
  • 1
  • 14
  • 31
lerosQ
  • 250
  • 3
  • 11