charles-zablit wrote:
> > The launch thread blocks on that event in `WaitForDebuggerConnection()`
>
> I feel like there's something missing in the PR description.
>
> If I understand correctly:
>
> 1. `ProcessDebugger::WaitForDebuggerConnection` waits for
> `m_initial_stop_event`
> 2. We get a debug exception.
> 3. `NativeProcessWindows::OnDebugException` is called.
> 4. `ProcessDebugger::OnDebuggerError` is called first - this triggers
> `m_initial_stop_event` waking up the launch thread.
> 5. `NativeProcessWindows::Handle{...}Exception` will modify the state of the
> process.
>
> Now usually 5 happens before the launch thread wakes up. But in some cases,
> it might wake up before 5 and would see the wrong state. Is this correct?
Yes, if you add a `Sleep(500)` in
https://github.com/llvm/llvm-project/blob/45829d78f3c9cc0660a9abbfad4b01cf87e82fee/lldb/source/Plugins/Process/Windows/Common/NativeProcessWindows.cpp#L578,
the race is deterministic.
I've edited the description of the PR to make it clearer.
https://github.com/llvm/llvm-project/pull/206469
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits