Peter Maydell <[email protected]> writes:

> On Wed, 23 Feb 2022 at 20:08, Ivan Shcherbakov <[email protected]> wrote:
>>
>
>>  static GDBState gdbserver_state;
>> +static bool gdbserver_is_connected;
>> +
>> +bool gdb_is_connected(void)
>> +{
>> +    return gdbserver_is_connected;
>> +}
>
> I haven't looked at the rest of the patch -- but can you explain where
> whpx is different from how other accelerators handle debug such that
> it needs to know whether gdb is connected or not ?

It's backwards from how it should work. I don't know about the other
accelerators but in the KVM case the gdbserver handles the requests for
installing breakpoints and watchpoints and if KVM is enabled passes them
onto the arch specific code.

When QEMU prepares to enter the run loop it checks for the presence of
those things and then can make the arch specific decision about how to
invoke KVM (see kvm_update_guest_debug and friends).

Just the fact you have connected to the gdbserver shouldn't affect how
you run WHPX up until the point there are things you need to trap - i.e.
handling installed breakpoints.

FWIW we rejected a similar patch a few weeks ago that wanted to change
emulation behaviour based on gdbserver connection status. 

>
> thanks
> -- PMM


-- 
Alex Bennée

Reply via email to