This is an archive of the discontinued LLVM Phabricator instance.

[lldb] [Process/NetBSD] Enable reporting of new and exited threads [WIP]
AbandonedPublic

Authored by mgorny on Jul 31 2019, 9:21 PM.

Details

Summary

// NB:
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.

Diff Detail

Event Timeline

mgorny created this revision.Jul 31 2019, 9:21 PM

Looks fine to me. Minor comments inline.

lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
271

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).

737

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.

mgorny marked an inline comment as done.Aug 1 2019, 12:18 AM
mgorny added inline comments.
lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
738

Note to self, this should be it =...

mgorny marked an inline comment as done.Aug 2 2019, 7:16 AM
mgorny added inline comments.
lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
737

For the record, I've copied it from Linux ;-P.

jfb requested changes to this revision.Aug 2 2019, 9:35 AM
jfb added inline comments.
lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
737

Are you serious? Because you absolutely cannot copy code from Linux into LLVM.

This revision now requires changes to proceed.Aug 2 2019, 9:35 AM
mgorny marked an inline comment as done.Aug 2 2019, 10:07 AM
mgorny added inline comments.
lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
737

I meant LLDB Linux Process plugin.

jingham added inline comments.
lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
737

I believe Michal means he copied it from the Linux NativeProcess implementation in lldb to the NetBSD Process plugin in lldb.

jfb added inline comments.Aug 2 2019, 10:21 AM
lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
737

OK, thank you for clarifying.

mgorny marked 6 inline comments as done.Aug 3 2019, 11:17 PM

@jfb, could you please remove your red flag now? ;-)

lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
738

Nevermind myself. It breaks immediately, so it doesn't matter.

mgorny updated this revision to Diff 213231.Aug 3 2019, 11:37 PM
krytarowski added inline comments.Aug 4 2019, 9:23 AM
lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
104

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.

jfb resigned from this revision.Aug 4 2019, 8:39 PM
mgorny marked an inline comment as done.Sep 13 2019, 1:05 PM
mgorny abandoned this revision.Sep 19 2019, 8:16 AM

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.