qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [5737] gdbstub: Return appropriate watch message to gdb (Ja


From: Anthony Liguori
Subject: [Qemu-devel] [5737] gdbstub: Return appropriate watch message to gdb (Jan Kiszka)
Date: Tue, 18 Nov 2008 19:55:44 +0000

Revision: 5737
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5737
Author:   aliguori
Date:     2008-11-18 19:55:44 +0000 (Tue, 18 Nov 2008)

Log Message:
-----------
gdbstub: Return appropriate watch message to gdb (Jan Kiszka)

Return the appropriate type prefix (r, a, none) when reporting
watchpoint hits to the gdb front-end.

Signed-off-by: Jan Kiszka <address@hidden>
Signed-off-by: Anthony Liguori <address@hidden>

Modified Paths:
--------------
    trunk/gdbstub.c

Modified: trunk/gdbstub.c
===================================================================
--- trunk/gdbstub.c     2008-11-18 19:46:41 UTC (rev 5736)
+++ trunk/gdbstub.c     2008-11-18 19:55:44 UTC (rev 5737)
@@ -1493,6 +1493,7 @@
 {
     GDBState *s = opaque;
     char buf[256];
+    const char *type;
     int ret;
 
     if (s->state == RS_SYSCALL)
@@ -1503,8 +1504,20 @@
 
     if (reason == EXCP_DEBUG) {
         if (s->env->watchpoint_hit) {
-            snprintf(buf, sizeof(buf), "T%02xwatch:" TARGET_FMT_lx ";",
-                     SIGTRAP,
+            switch (s->env->watchpoint[s->env->watchpoint_hit - 1].type &
+                    (PAGE_READ | PAGE_WRITE)) {
+            case PAGE_READ:
+                type = "r";
+                break;
+            case PAGE_READ | PAGE_WRITE:
+                type = "a";
+                break;
+            default:
+                type = "";
+                break;
+            }
+            snprintf(buf, sizeof(buf), "T%02x%swatch:" TARGET_FMT_lx ";",
+                     SIGTRAP, type,
                      s->env->watchpoint[s->env->watchpoint_hit - 1].vaddr);
             put_packet(s, buf);
             s->env->watchpoint_hit = 0;






reply via email to

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