Thursday, December 10, 2015

How to Debug Qemu

In order to debug Qemu, one first runs the -s and -S options in qemu:
$ qemu -s -S -hda hda.img

This will pause qemu and wait for gdb connection tcp port 1234.


Open up another terminal and run the following db command
$ gdb
(gdb) target remote localhost:1234


Now, we may want to setup the break point. If you want to setup the break point as soon as the system starts, that is memory address 0x7c00, so set the break point and continue!
(gdb) b *0x7c00
(gdb) c

No comments:

Post a Comment