QEMU: Difference between revisions

[unchecked revision][unchecked revision]
Content deleted Content added
→‎See Also: Added a link to a page for fixing 'packet too long' error.
m →‎GDB-stub: Added note about omtimizations potentially breaking the debugger, and how to fix. ~~~~
Line 139:
target remote localhost:1234
 
will load into GDB your kernel and then connect to QEMU. Be sure to compile your kernel with the GCC option <tt>-g</tt> for debugging symbols. (If you find that the debugger can't find local variables, try using the <tt>-fno-omit-frame-pointer</tt> option when compiling, or disable optimizations.) Now you may debug your kernel as a C program.
If you have an SMP kernel, check out the <tt>info threads</tt> and <tt>thread</tt> commands. It is also possible to use the QEMU monitor and its commands using the <tt>monitor</tt> command in GDB. For a list of available commands and their description, check out <tt>monitor help</tt>.