Now, this patch is most likely correct. However, I've tested it only with the other patch applied, and many tests started hanging forever. If you have any comments, I'd be happy to process them but I won't commit it until all the issues have been resolved.
labath krytarowski jfb
Looks fine to me. Minor comments inline.
I don't think you need this. Given that you never reported a stop event, as far as the rest of the world is concerned the process is still "running" (i.e., this "stop to notice a new thread" is just an implementation detail).
It looks like the rest of the code assumes (as I think it should) that the thread list does not contain null pointers. See e.g. the loop on line 276.
For the record, I've copied it from Linux ;-P.
Are you serious? Because you absolutely cannot copy code from Linux into LLVM.
I believe Michal means he copied it from the Linux NativeProcess implementation in lldb to the NetBSD Process plugin in lldb.
I would go for more generic PT_GET_EVENT_MASK and then |=. In theory we could add more bits and make them enabled by default.
The problem is to complex too be implemented in smaller blocks. I'm going to close this in favor of a single unified patch in D64647.