aboutsummaryrefslogtreecommitdiff
path: root/gdbstub.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2011-02-09 16:29:40 +0100
committerMarcelo Tosatti <mtosatti@redhat.com>2011-02-14 12:39:46 -0200
commite07bbac542d45cb246f393f343eb3b867fed4de1 (patch)
treee2a40a4a9ac0d15b9f948a693b7b967489b93886 /gdbstub.c
parent0ab07c623c629acfbc792e5a174129c19faefbb7 (diff)
Improve vm_stop reason declarations
Define and use dedicated constants for vm_stop reasons, they actually have nothing to do with the EXCP_* defines used so far. At this chance, specify more detailed reasons so that VM state change handlers can evaluate them. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'gdbstub.c')
-rw-r--r--gdbstub.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/gdbstub.c b/gdbstub.c
index d6556c9a2f..ed51a8a5bb 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -2194,14 +2194,14 @@ static void gdb_vm_state_change(void *opaque, int running, int reason)
const char *type;
int ret;
- if (running || (reason != EXCP_DEBUG && reason != EXCP_INTERRUPT) ||
- s->state == RS_INACTIVE || s->state == RS_SYSCALL)
+ if (running || (reason != VMSTOP_DEBUG && reason != VMSTOP_USER) ||
+ s->state == RS_INACTIVE || s->state == RS_SYSCALL) {
return;
-
+ }
/* disable single step if it was enable */
cpu_single_step(env, 0);
- if (reason == EXCP_DEBUG) {
+ if (reason == VMSTOP_DEBUG) {
if (env->watchpoint_hit) {
switch (env->watchpoint_hit->flags & BP_MEM_ACCESS) {
case BP_MEM_READ:
@@ -2252,7 +2252,7 @@ void gdb_do_syscall(gdb_syscall_complete_cb cb, const char *fmt, ...)
gdb_current_syscall_cb = cb;
s->state = RS_SYSCALL;
#ifndef CONFIG_USER_ONLY
- vm_stop(EXCP_DEBUG);
+ vm_stop(VMSTOP_DEBUG);
#endif
s->state = RS_IDLE;
va_start(va, fmt);
@@ -2326,7 +2326,7 @@ static void gdb_read_byte(GDBState *s, int ch)
if (vm_running) {
/* when the CPU is running, we cannot do anything except stop
it when receiving a char */
- vm_stop(EXCP_INTERRUPT);
+ vm_stop(VMSTOP_USER);
} else
#endif
{
@@ -2588,7 +2588,7 @@ static void gdb_chr_event(void *opaque, int event)
{
switch (event) {
case CHR_EVENT_OPENED:
- vm_stop(EXCP_INTERRUPT);
+ vm_stop(VMSTOP_USER);
gdb_has_xml = 0;
break;
default:
@@ -2628,8 +2628,9 @@ static int gdb_monitor_write(CharDriverState *chr, const uint8_t *buf, int len)
#ifndef _WIN32
static void gdb_sigterm_handler(int signal)
{
- if (vm_running)
- vm_stop(EXCP_INTERRUPT);
+ if (vm_running) {
+ vm_stop(VMSTOP_USER);
+ }
}
#endif