OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 4:22 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 19 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Qemu vs Bochs+gdb vs Bochs internal debugger
PostPosted: Mon Oct 05, 2015 9:33 am 
Offline
Member
Member

Joined: Sun Feb 01, 2009 6:11 am
Posts: 1070
Location: Germany
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.

Quote:
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)


Top
 Profile  
 
 Post subject: Re: Qemu vs Bochs+gdb vs Bochs internal debugger
PostPosted: Mon Oct 05, 2015 7:23 pm 
Offline
Member
Member

Joined: Mon Jan 03, 2011 6:58 pm
Posts: 283
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:
xchg bx, bx


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

- Monk


Top
 Profile  
 
 Post subject: Re: Qemu vs Bochs+gdb vs Bochs internal debugger
PostPosted: Mon Oct 05, 2015 7:46 pm 
Offline
Member
Member
User avatar

Joined: Fri Jan 16, 2009 8:34 pm
Posts: 284
Location: Louisiana, USA
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:
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.


Top
 Profile  
 
 Post subject: Re: Qemu vs Bochs+gdb vs Bochs internal debugger
PostPosted: Wed Oct 07, 2015 1:01 am 
Offline
User avatar

Joined: Wed Dec 17, 2008 11:22 am
Posts: 8
To everyone of you : Thank you very much for your help ! =D> =D> =D>


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page Previous  1, 2

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 34 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group