qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] gdb support for qemu-mips (user mode)


From: Dave Denholm
Subject: [Qemu-devel] gdb support for qemu-mips (user mode)
Date: Wed, 25 Oct 2006 13:04:12 +0100
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.4 (gnu/linux)

Hi,
   user-mode emulation of mips allows gdb to connect and set
breakpoints, but when the breakpoint is reached, the emulator bombs
out with an unhandled cpu exception 0x10002 (or something like that).

I think it's just a missing  case EXCP_DEBUG in the mips-specific
cpu_loop in linux-user/main.c (around line 1301 in 0.8.2)

Since all the other archs do exactly the same thing for EXCP_DEBUG, I
just pasted that code into the mips version, and it seemed to work, at
least a bit - when I was single-stepping through a fn, gdb got stuck
complaining that it couldn't find a fn for a given ip address.

dd
-- 
Dave Denholm              <address@hidden>       http://www.esmertec.com


--- linux-user/main.c.~1~       2006-07-22 18:23:34.000000000 +0100
+++ linux-user/main.c   2006-10-25 11:14:30.752887950 +0100
@@ -1350,6 +1350,20 @@
         case EXCP_INTERRUPT:
             /* just indicate that signals should be handled asap */
             break;
+        case EXCP_DEBUG:
+            {
+                int sig;
+
+                sig = gdb_handlesig (env, TARGET_SIGTRAP);
+                if (sig)
+                  {
+                    info.si_signo = sig;
+                    info.si_errno = 0;
+                    info.si_code = TARGET_TRAP_BRKPT;
+                    queue_signal(info.si_signo, &info);
+                  }
+            }
+            break;
         default:
             //        error:
             fprintf(stderr, "qemu: unhandled CPU exception 0x%x - aborting\n", 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]