[Lldb-commits] [PATCH] D64647: [lldb] [Process/NetBSD] Implement per-thread execution control

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Jul 31 23:54:49 PDT 2019

labath added a comment.

In D64647#1609600 <https://reviews.llvm.org/D64647#1609600>, @mgorny wrote:

> It seems that the patch is wrong with the current logic, and this is somehow blurry because of Linux implementation limitations. FWIU, `eStateSuspended` will never happen and instead we should keep threads without explicit action suspsended. It's unclear yet whether this is desirable long-term, or if we should change the logic to explicitly indicate state for each thread.

Yes, eStateSuspended will never happen on linux. It wouldn't be too hard to make use of that state -- we could set unresumed threads to "suspened" in NPL::Resume, and then when we go to stop all threads (NPL::StopRunningThreads), we would just avoid sending signals to suspended threads and just silently set them back to "stopped". However, I don't see a reason to do that now, as it would just add code for jumping between the states.

However, if it makes your life easier, I think you should be able to use eStateSuspended inside NetBSD code for anything you want. Nobody will inspect the state of threads while the process is running, so that could just be an implementation detail.

In fact I suspect the nobody will inspect the thread state whatsoever because once the process is stopped, all threads are assumed to be stopped too.



More information about the lldb-commits mailing list