Qemu vs Bochs+gdb vs Bochs internal debugger

Programming, for all ages and all languages.
Kevin
Member
Member
Posts: 1071
Joined: Sun Feb 01, 2009 6:11 am
Location: Germany
Contact:

Re: Qemu vs Bochs+gdb vs Bochs internal debugger

Post by Kevin »

bscreator wrote:So GDB only have problems if you change your processor mode, for example switching 16-32Bit, switching Real-/Protected Mode, is this correct ?
This is what I remember, yes.
You need GDB for debugging in QEMU. Or is there another way for debugging/setting breakpoints in QEMU ?
It depends on what you call "debugging". The qemu monitor (accessed with Ctrl-Alt-2) allows some inspection of the VM, including CPU state, memory dumps, TLB contents and some devices. It doesn't allow setting breakpoints or singlestepping or things like that.

You can, however, set a breakpoint in gdb and when that breakpoint stops the VM, you can inspect it both in gdb and in the qemu monitor. Generally, if you want to debug your kernel on a source code level, you'll want to do that in gdb, but if you're interested in machine state, you'll do it in the qemu monitor.
Developer of tyndur - community OS of Lowlevel (German)
FallenAvatar
Member
Member
Posts: 283
Joined: Mon Jan 03, 2011 6:58 pm

Re: Qemu vs Bochs+gdb vs Bochs internal debugger

Post by FallenAvatar »

bscreator wrote:- I start Bochs with debugger and always have to manually set a breakpoint to specific memory places, like 0x7C00. Is there an "automatically" way to say Bochs when it starts, that it has to set an breakpoint at 0x7C00? Maybe in some kind of script ?

Code: Select all

xchg bx, bx
Should cause Bochs to break on that line. Not 100% sure if there is a config setting needed.

- Monk
User avatar
BASICFreak
Member
Member
Posts: 284
Joined: Fri Jan 16, 2009 8:34 pm
Location: Louisiana, USA

Re: Qemu vs Bochs+gdb vs Bochs internal debugger

Post by BASICFreak »

tjmonk15 wrote:
bscreator wrote:- I start Bochs with debugger and always have to manually set a breakpoint to specific memory places, like 0x7C00. Is there an "automatically" way to say Bochs when it starts, that it has to set an breakpoint at 0x7C00? Maybe in some kind of script ?

Code: Select all

xchg bx, bx
Should cause Bochs to break on that line. Not 100% sure if there is a config setting needed.

- Monk
Yes there is a config setting:
magic_break: enabled=1

And for E9 Hack:
port_e9_hack: enabled=1
BOS Source Thanks to GitHub
BOS Expanded Commentary
Both under active development!
Sortie wrote:
  • Don't play the role of an operating systems developer, be one.
  • Be truly afraid of undefined [behavior].
  • Your operating system should be itself, not fight what it is.
User avatar
bscreator
Posts: 8
Joined: Wed Dec 17, 2008 11:22 am

Re: Qemu vs Bochs+gdb vs Bochs internal debugger

Post by bscreator »

To everyone of you : Thank you very much for your help ! =D> =D> =D>
Post Reply