Step debugging with QEMU

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
sst1
Posts: 1
Joined: Sun Mar 14, 2010 4:23 pm

Step debugging with QEMU

Post by sst1 »

I've got my kernel working with PowerPC (isim built into gdb) but I've started to port it over to x86.

Seeing as there's no built in simulator that I could see, I've followed the debugging information on this site and have QEMU built and working. However, I only seem to be able to debug to breakpoints - if i continue or "step" then execution continues until the next breakpoint rather than stepping correctly.

The only changes I've made to QEMU (0.12.13) are to run the socket as Ip4 rather than Ip6.

Is this caused by something in the kernel that it should be stepping up or is it solely an error in my QEMU build?

Below is the change I made to QEMU:

Code: Select all

diff -urpN qemu-0.12.1/gdbstub.c samos_qemu-0.12.1/gdbstub.c
--- qemu-0.12.1/gdbstub.c	2009-12-20 01:32:16.000000000 +0000
+++ samos_qemu-0.12.1/gdbstub.c	2010-01-17 16:43:29.752978300 +0000
@@ -2564,7 +2564,7 @@ int gdbserver_start(const char *device)
         if (strstart(device, "tcp:", NULL)) {
             /* enforce required TCP attributes */
             snprintf(gdbstub_device_name, sizeof(gdbstub_device_name),
-                     "%s,nowait,nodelay,server", device);
+                     "%s,nowait,nodelay,server,ipv4", device);
             device = gdbstub_device_name;
         }
 #ifndef _WIN32
Any ideas how I can get QEMU to step properly?

Ta
Post Reply