[Lldb-commits] [PATCH] D33778: Add a NativeProcessProtocol Factory class

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Jun 1 12:15:43 PDT 2017

labath added inline comments.

Comment at: source/Plugins/Process/Linux/NativeProcessLinux.h:148
-  ::pid_t Attach(lldb::pid_t pid, Status &error);
+  static llvm::Expected<std::vector<::pid_t>> Attach(::pid_t pid);
zturner wrote:
> Before it was only returning 1, now it's returning a vector.  Any reason?
I've refactored the function a bit. It now returns a list of threads that it has attached to. Previously it stored them in the object itself, but now it can't as I don't construct a process object until I know that the attach has succeeded.

I should probably document the return value though.

Comment at: source/Plugins/Process/Linux/NativeProcessLinux.h:152
-  static void *MonitorThread(void *baton);
+  void InitializeThreads(llvm::ArrayRef<::pid_t> tids);
zturner wrote:
> Shouldn't this be `tid_t`?
I'm using native thread types in this code. I think that makes more sense as this is the thing that actually interfaces with system APIs. linux does not have a separate type for thread IDs.


More information about the lldb-commits mailing list