[5737] gdbstub: Return appropriate watch message to gdb (Jan Kiszka)
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 <[email protected]>
Signed-off-by Anthony Liguori <[email protected]>
Modified Paths:
--------------
trunk/gdbstub.c
Modified: trunk/gdbstub.c
===================================================================
gdbstub.c +15 -2
@@ -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 ;