qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 8/8] Rework debug exception processing for gdb


From: Jun Koi
Subject: Re: [Qemu-devel] [PATCH 8/8] Rework debug exception processing for gdb use
Date: Fri, 23 Jul 2010 14:44:47 +0900

On Fri, Jul 23, 2010 at 1:58 PM, TeLeMan <address@hidden> wrote:
> On Fri, Jun 25, 2010 at 22:56, Jan Kiszka <address@hidden> 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 <address@hidden>
>> ---
>>  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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]