summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-01-22 17:15:29 +0000
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-01-22 17:15:29 +0000
commit9781e0401ad7d2d30e48fd532372d4ef80be58b6 (patch)
tree4660f374d3cd785ce476d45d9407fcd094e72c59 /gdbstub.c
parentExtend gitignore (Jan Kiszka) (diff)
downloadqemu-kvm-9781e0401ad7d2d30e48fd532372d4ef80be58b6.tar.gz
qemu-kvm-9781e0401ad7d2d30e48fd532372d4ef80be58b6.tar.bz2
qemu-kvm-9781e0401ad7d2d30e48fd532372d4ef80be58b6.zip
Rework vm_state_change notifiers (Jan Kiszka)
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6402 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'gdbstub.c')
-rw-r--r--gdbstub.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/gdbstub.c b/gdbstub.c
index 2921a04ed..2be19f0ca 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -1867,7 +1867,7 @@ void gdb_set_stop_cpu(CPUState *env)
}
#ifndef CONFIG_USER_ONLY
-static void gdb_vm_stopped(void *opaque, int reason)
+static void gdb_vm_state_change(void *opaque, int running, int reason)
{
GDBState *s = gdbserver_state;
CPUState *env = s->c_cpu;
@@ -1875,7 +1875,8 @@ static void gdb_vm_stopped(void *opaque, int reason)
const char *type;
int ret;
- if (s->state == RS_SYSCALL)
+ if (running || (reason != EXCP_DEBUG && reason != EXCP_INTERRUPT) ||
+ s->state == RS_SYSCALL)
return;
/* disable single step if it was enable */
@@ -1904,10 +1905,8 @@ static void gdb_vm_stopped(void *opaque, int reason)
}
tb_flush(env);
ret = GDB_SIGNAL_TRAP;
- } else if (reason == EXCP_INTERRUPT) {
- ret = GDB_SIGNAL_INT;
} else {
- ret = 0;
+ ret = GDB_SIGNAL_INT;
}
snprintf(buf, sizeof(buf), "T%02xthread:%02x;", ret, env->cpu_index+1);
put_packet(s, buf);
@@ -2300,7 +2299,7 @@ int gdbserver_start(const char *port)
gdbserver_state = s;
qemu_chr_add_handlers(chr, gdb_chr_can_receive, gdb_chr_receive,
gdb_chr_event, NULL);
- qemu_add_vm_stop_handler(gdb_vm_stopped, NULL);
+ qemu_add_vm_change_state_handler(gdb_vm_state_change, NULL);
return 0;
}
#endif