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 <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5737 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
6b9175478e
commit
d6fc1b397b
17
gdbstub.c
17
gdbstub.c
|
@ -1493,6 +1493,7 @@ static void gdb_vm_stopped(void *opaque, int reason)
|
||||||
{
|
{
|
||||||
GDBState *s = opaque;
|
GDBState *s = opaque;
|
||||||
char buf[256];
|
char buf[256];
|
||||||
|
const char *type;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (s->state == RS_SYSCALL)
|
if (s->state == RS_SYSCALL)
|
||||||
|
@ -1503,8 +1504,20 @@ static void gdb_vm_stopped(void *opaque, int reason)
|
||||||
|
|
||||||
if (reason == EXCP_DEBUG) {
|
if (reason == EXCP_DEBUG) {
|
||||||
if (s->env->watchpoint_hit) {
|
if (s->env->watchpoint_hit) {
|
||||||
snprintf(buf, sizeof(buf), "T%02xwatch:" TARGET_FMT_lx ";",
|
switch (s->env->watchpoint[s->env->watchpoint_hit - 1].type &
|
||||||
SIGTRAP,
|
(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);
|
s->env->watchpoint[s->env->watchpoint_hit - 1].vaddr);
|
||||||
put_packet(s, buf);
|
put_packet(s, buf);
|
||||||
s->env->watchpoint_hit = 0;
|
s->env->watchpoint_hit = 0;
|
||||||
|
|
Loading…
Reference in New Issue