Improve readability by moving the continue operation into aseparate function.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4059 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
edgar_igl 2008-03-14 06:10:42 +00:00
parent ca87d03b77
commit ba70a624e9

View File

@ -121,6 +121,16 @@ int use_gdb_syscalls(void)
return gdb_syscall_mode == GDB_SYS_ENABLED; return gdb_syscall_mode == GDB_SYS_ENABLED;
} }
/* Resume execution. */
static inline void gdb_continue(GDBState *s)
{
#ifdef CONFIG_USER_ONLY
s->running_state = 1;
#else
vm_start();
#endif
}
static void put_buffer(GDBState *s, const uint8_t *buf, int len) static void put_buffer(GDBState *s, const uint8_t *buf, int len)
{ {
#ifdef CONFIG_USER_ONLY #ifdef CONFIG_USER_ONLY
@ -908,11 +918,7 @@ static int gdb_handle_packet(GDBState *s, CPUState *env, const char *line_buf)
env->pc = addr; env->pc = addr;
#endif #endif
} }
#ifdef CONFIG_USER_ONLY gdb_continue(s);
s->running_state = 1;
#else
vm_start();
#endif
return RS_IDLE; return RS_IDLE;
case 's': case 's':
if (*p != '\0') { if (*p != '\0') {
@ -935,11 +941,7 @@ static int gdb_handle_packet(GDBState *s, CPUState *env, const char *line_buf)
#endif #endif
} }
cpu_single_step(env, 1); cpu_single_step(env, 1);
#ifdef CONFIG_USER_ONLY gdb_continue(s);
s->running_state = 1;
#else
vm_start();
#endif
return RS_IDLE; return RS_IDLE;
case 'F': case 'F':
{ {
@ -961,11 +963,7 @@ static int gdb_handle_packet(GDBState *s, CPUState *env, const char *line_buf)
if (type == 'C') { if (type == 'C') {
put_packet(s, "T02"); put_packet(s, "T02");
} else { } else {
#ifdef CONFIG_USER_ONLY gdb_continue(s);
s->running_state = 1;
#else
vm_start();
#endif
} }
} }
break; break;