aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h
diff options
context:
space:
mode:
authorMichał Górny <mgorny@moritz.systems>2021-04-13 17:32:23 +0200
committerMichał Górny <mgorny@moritz.systems>2021-04-24 11:08:33 +0200
commitbbae0c1f7b4f60e9b8ac2be24e35bec79d9b7b01 (patch)
tree656b03a27caa7a0864a7329683fd1b567e0c0f44 /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h
parent6c37984ebaf4ee01df6a9b3f78e45f70dcd6fb33 (diff)
downloadllvm-bbae0c1f7b4f60e9b8ac2be24e35bec79d9b7b01.zip
llvm-bbae0c1f7b4f60e9b8ac2be24e35bec79d9b7b01.tar.gz
llvm-bbae0c1f7b4f60e9b8ac2be24e35bec79d9b7b01.tar.bz2
[lldb] [llgs] Support owning and detaching extra processes
Add a NativeDelegate API to pass new processes (forks) to LLGS, and support detaching them via the 'D' packet. A 'D' packet without a specific PID detaches all processes, otherwise it detaches either the specified subprocess or the main process, depending on the passed PID. Differential Revision: https://reviews.llvm.org/D100191
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h
index 32970ae..bfc4f79 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h
@@ -78,6 +78,10 @@ public:
void DidExec(NativeProcessProtocol *process) override;
+ void
+ NewSubprocess(NativeProcessProtocol *parent_process,
+ std::unique_ptr<NativeProcessProtocol> child_process) override;
+
Status InitializeConnection(std::unique_ptr<Connection> connection);
protected:
@@ -89,7 +93,8 @@ protected:
NativeProcessProtocol *m_current_process;
NativeProcessProtocol *m_continue_process;
std::recursive_mutex m_debugged_process_mutex;
- std::unique_ptr<NativeProcessProtocol> m_debugged_process_up;
+ std::unordered_map<lldb::pid_t, std::unique_ptr<NativeProcessProtocol>>
+ m_debugged_processes;
Communication m_stdio_communication;
MainLoop::ReadHandleUP m_stdio_handle_up;