qemu-devel
[Top][All Lists]
Advanced

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

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


From: Jan Kiszka
Subject: [Qemu-devel] Re: [PATCH 8/8] Rework debug exception processing for gdb use
Date: Fri, 23 Jul 2010 09:57:55 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666

Jun Koi wrote:
> 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.

This works analogously to vmstop_requested: The stop reason code is
transfered along the request. Granted, there is only one code used here
so far.

This whole thing could probably be simplified if we did not have to
support both single- and multi-threaded QEMU execution models. But
that's the situation ATM.

Jan

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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