On Fri, Jul 23, 2010 at 1:58 PM, TeLeMan <gele...@gmail.com> wrote: > On Fri, Jun 25, 2010 at 22:56, Jan Kiszka <jan.kis...@siemens.com> wrote: >> Guest debugging is currently broken under CONFIG_IOTHREAD. The reason is >> inconsistent or even lacking signaling the debug events from the source >> VCPU to the main loop and the gdbstub. >> >> This patch addresses the issue by pushing this signaling into a >> CPUDebugExcpHandler: cpu_debug_handler is registered as first handler, >> thus will be executed last after potential breakpoint emulation >> handlers. It sets informs the gdbstub about the debug event source, >> requests a debug exit of the main loop and stops the current VCPU. This >> mechanism works both for TCG and KVM, with and without IO-thread. >> >> Signed-off-by: Jan Kiszka <jan.kis...@siemens.com> >> --- >> cpus.c | 26 ++++++++++++++++---------- >> kvm-all.c | 2 -- >> 2 files changed, 16 insertions(+), 12 deletions(-) >> >> diff --git a/cpus.c b/cpus.c >> index c024421..a607d9a 100644 >> --- a/cpus.c >> +++ b/cpus.c >> @@ -140,6 +140,13 @@ static int any_cpu_has_work(void) >> return 0; >> } >> >> +static void cpu_debug_handler(CPUState *env) >> +{ >> + gdb_set_stop_cpu(env); >> + debug_requested = EXCP_DEBUG; >> + vm_stop(EXCP_DEBUG); >> +} > > Is debug_requested or vm_stop() redundant? >
certainly that debug_requested should only take value of 0 or 1. thanks, J