[Lldb-commits] [PATCH] D100191: [lldb] [llgs] Support owning and detaching extra processes

Michał Górny via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Apr 14 14:27:51 PDT 2021


mgorny added inline comments.


================
Comment at: lldb/include/lldb/Host/common/NativeProcessProtocol.h:226
+    NewSubprocess(NativeProcessProtocol *parent_process,
+                  std::unique_ptr<NativeProcessProtocol> &child_process) = 0;
   };
----------------
labath wrote:
> That way, the delegate _must_ do something with the child process.
Indeed, it must. Unfortunately, this breaks `MockDelegate`:

```
/home/mgorny/git/llvm-project/lldb/unittests/TestingSupport/Host/NativeProcessTestUtils.h: In member function ‘virtual testing::internal::Function<void()>::Result lldb_private::MockDelegate::NewSubprocess(testing::internal::Function<void(lldb_private::NativeProcessProtocol*)>::Argument1, testing::internal::Function<void(lldb_private::NativeProcessProtocol*, std::unique_ptr<lldb_private::NativeProcessProtocol>)>::Argument2)’:
/home/mgorny/git/llvm-project/llvm/utils/unittest/googlemock/include/gmock/gmock-generated-function-mockers.h:405:73: error: use of deleted function ‘std::unique_ptr<_Tp, _Dp>::unique_ptr(const std::unique_ptr<_Tp, _Dp>&) [with _Tp = lldb_private::NativeProcessProtocol; _Dp = std::default_delete<lldb_private::NativeProcessProtocol>]’
  405 |     return GMOCK_MOCKER_(2, constness, Method).Invoke(gmock_a1, gmock_a2); \
      |                                                                         ^
/home/mgorny/git/llvm-project/llvm/utils/unittest/googlemock/include/gmock/gmock-generated-function-mockers.h:679:30: note: in expansion of macro ‘GMOCK_METHOD2_’
  679 | #define MOCK_METHOD2(m, ...) GMOCK_METHOD2_(, , , m, __VA_ARGS__)
      |                              ^~~~~~~~~~~~~~
/home/mgorny/git/llvm-project/lldb/unittests/TestingSupport/Host/NativeProcessTestUtils.h:28:3: note: in expansion of macro ‘MOCK_METHOD2’
   28 |   MOCK_METHOD2(NewSubprocess,
      |   ^~~~~~~~~~~~
[...]
```

and then there are a few pages of errors.


================
Comment at: lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp:3199
 
   StopSTDIOForwarding();
 
----------------
Hmm, I suppose this should only happen if we're detaching all processes, or...?


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

https://reviews.llvm.org/D100191



More information about the lldb-commits mailing list