labath added a comment.

Ah, I'm sorry. It seems I misunderstood the nature of the problem. Let me try 
again.

In your description of the problem, I think the problematic part is the 
sequencing of steps 5 and 6. You're saying that the main thread returns from a 
"synchronous" launch operation even though the stop event is still being 
processed by the event handler thread. That doesn't seem right to me because 
the whole point of switching to synchronous mode was to ensure that, by the 
time the operation returns, the process is stopped and ready to accept 
additional commands. That won't work if the stop hooks are still running in the 
background.

So, I'd say that the bug is caused by the lack of proper ordering between these 
two events, and instead of making the code cope with it, the right fix is to 
add the synchronization. I think that could be achieved by "hijacking" the 
process events in the case of a synchronous launch, similar to how we do it for 
synchronous resumes (compare Process::Resume and Process:ResumeSynchronous) -- 
except that this may be slightly trickier to implement because some of our 
(platform-specific) launch code already hijacks these events.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119548/new/

https://reviews.llvm.org/D119548

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to