[Lldb-commits] [lldb] [lldb-dap] Fix raciness in launch and attach tests (PR #137920)
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Fri May 2 04:46:15 PDT 2025
================
@@ -167,14 +167,23 @@ static void EventThreadFunction(DAP &dap) {
// stop events which we do not want to send an event for. We will
// manually send a stopped event in request_configurationDone(...)
// so don't send any before then.
- if (dap.configuration_done_sent) {
- // Only report a stopped event if the process was not
- // automatically restarted.
- if (!lldb::SBProcess::GetRestartedFromEvent(event)) {
- SendStdOutStdErr(dap, process);
- SendThreadStoppedEvent(dap);
+ {
----------------
labath wrote:
That is true, but it should only matter if someone actually cares about the process in the mean time. Provided we don't need to inspect the state, a sequence like this should be fine:
1. cause a process event to be emitted
2. start the listener thread
3. listener thread receives the event
But I don't know if that's the case here...
Another potential option: If we are sure the event is going to be emitted (and the listener thread is not running), maybe we can wait for the event (synchronously) on the thread which is processing the request.
https://github.com/llvm/llvm-project/pull/137920
More information about the lldb-commits
mailing list