Commit e568902a02aa58dc53d4158aa2942ef3ff08a9ce
1 parent
4870852c
qemu: use debug_requested global instead of cpu_exec return (Marcelo Tosatti)
Necessary for the next refactoring patch. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7245 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
14 additions
and
3 deletions
vl.c
| ... | ... | @@ -3568,6 +3568,7 @@ static QEMUResetEntry *first_reset_entry; |
| 3568 | 3568 | static int reset_requested; |
| 3569 | 3569 | static int shutdown_requested; |
| 3570 | 3570 | static int powerdown_requested; |
| 3571 | +static int debug_requested; | |
| 3571 | 3572 | |
| 3572 | 3573 | int qemu_shutdown_requested(void) |
| 3573 | 3574 | { |
| ... | ... | @@ -3590,6 +3591,13 @@ int qemu_powerdown_requested(void) |
| 3590 | 3591 | return r; |
| 3591 | 3592 | } |
| 3592 | 3593 | |
| 3594 | +static int qemu_debug_requested(void) | |
| 3595 | +{ | |
| 3596 | + int r = debug_requested; | |
| 3597 | + debug_requested = 0; | |
| 3598 | + return r; | |
| 3599 | +} | |
| 3600 | + | |
| 3593 | 3601 | void qemu_register_reset(QEMUResetHandler *func, void *opaque) |
| 3594 | 3602 | { |
| 3595 | 3603 | QEMUResetEntry **pre, *re; |
| ... | ... | @@ -4019,6 +4027,8 @@ static int vm_can_run(void) |
| 4019 | 4027 | return 0; |
| 4020 | 4028 | if (shutdown_requested) |
| 4021 | 4029 | return 0; |
| 4030 | + if (debug_requested) | |
| 4031 | + return 0; | |
| 4022 | 4032 | return 1; |
| 4023 | 4033 | } |
| 4024 | 4034 | |
| ... | ... | @@ -4045,6 +4055,7 @@ static void main_loop(void) |
| 4045 | 4055 | ret = qemu_cpu_exec(env); |
| 4046 | 4056 | if (ret == EXCP_DEBUG) { |
| 4047 | 4057 | gdb_set_stop_cpu(env); |
| 4058 | + debug_requested = 1; | |
| 4048 | 4059 | break; |
| 4049 | 4060 | } |
| 4050 | 4061 | } |
| ... | ... | @@ -4055,11 +4066,11 @@ static void main_loop(void) |
| 4055 | 4066 | #ifdef CONFIG_PROFILER |
| 4056 | 4067 | dev_time += profile_getclock() - ti; |
| 4057 | 4068 | #endif |
| 4058 | - } while (ret != EXCP_DEBUG && vm_can_run()); | |
| 4069 | + } while (vm_can_run()); | |
| 4059 | 4070 | |
| 4060 | - if (ret == EXCP_DEBUG) | |
| 4061 | - vm_stop(EXCP_DEBUG); | |
| 4062 | 4071 | |
| 4072 | + if (qemu_debug_requested()) | |
| 4073 | + vm_stop(EXCP_DEBUG); | |
| 4063 | 4074 | if (qemu_shutdown_requested()) { |
| 4064 | 4075 | if (no_shutdown) { |
| 4065 | 4076 | vm_stop(0); | ... | ... |