diff options
author | edgar_igl <edgar_igl@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-03-14 06:10:42 +0000 |
---|---|---|
committer | edgar_igl <edgar_igl@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-03-14 06:10:42 +0000 |
commit | ba70a624e9fae13d349111311b522771122a4dd9 (patch) | |
tree | bc8d1c9860873c29cc0d3e31e3f413282627a2fd /gdbstub.c | |
parent | ca87d03b77aade91926972b7e20b5382b59d1c77 (diff) | |
download | qemu-ba70a624e9fae13d349111311b522771122a4dd9.tar.gz qemu-ba70a624e9fae13d349111311b522771122a4dd9.tar.bz2 qemu-ba70a624e9fae13d349111311b522771122a4dd9.zip |
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
Diffstat (limited to 'gdbstub.c')
-rw-r--r-- | gdbstub.c | 28 |
1 files changed, 13 insertions, 15 deletions
@@ -121,6 +121,16 @@ int use_gdb_syscalls(void) 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) { #ifdef CONFIG_USER_ONLY @@ -908,11 +918,7 @@ static int gdb_handle_packet(GDBState *s, CPUState *env, const char *line_buf) env->pc = addr; #endif } -#ifdef CONFIG_USER_ONLY - s->running_state = 1; -#else - vm_start(); -#endif + gdb_continue(s); return RS_IDLE; case 's': if (*p != '\0') { @@ -935,11 +941,7 @@ static int gdb_handle_packet(GDBState *s, CPUState *env, const char *line_buf) #endif } cpu_single_step(env, 1); -#ifdef CONFIG_USER_ONLY - s->running_state = 1; -#else - vm_start(); -#endif + gdb_continue(s); return RS_IDLE; case 'F': { @@ -961,11 +963,7 @@ static int gdb_handle_packet(GDBState *s, CPUState *env, const char *line_buf) if (type == 'C') { put_packet(s, "T02"); } else { -#ifdef CONFIG_USER_ONLY - s->running_state = 1; -#else - vm_start(); -#endif + gdb_continue(s); } } break; |