summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h
diff options
context:
space:
mode:
authorTodd Fiala <tfiala@google.com>2014-01-23 22:05:44 +0000
committerTodd Fiala <tfiala@google.com>2014-01-23 22:05:44 +0000
commit403edc5c57b608585b94c93a648333231a9c68c7 (patch)
treea3e7f3f652ab7e5822046300a579766f6e3f1602 /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h
parenta786e53903c08e0d0f04c92b0f32e83005e252ce (diff)
downloadbcm5719-llvm-403edc5c57b608585b94c93a648333231a9c68c7.tar.gz
bcm5719-llvm-403edc5c57b608585b94c93a648333231a9c68c7.zip
Move process launching into GDBRemoteCommunicationServer.
lldb-gdbserver was launching the commandline-specified launch process directly, without GDBRemoteCommunicationServer knowing anything about it. As GDBRemoteCommunicationServer is the piece that manages and knows about processes that the gdb remote protocol discusses with the client end, it is important that it know about launched processes. This change also implements the k gdb remote protocol message, having it kill all known spawned processes when it is received. (Note: in lldb-gdbserver, the spawned processes are not properly monitored yet. The response to the k packet will complain that spawned processes do not really appear to be getting killed even if they are. This will get addressed soon.) llvm-svn: 199945
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h
index 3b70ab97327..c1223ad0a34 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h
@@ -138,6 +138,29 @@ public:
m_port_offset = port_offset;
}
+ //------------------------------------------------------------------
+ /// Launch a process.
+ ///
+ /// This method supports running an lldb-gdbserver or similar
+ /// server in a situation where the startup code has been provided
+ /// with all the information for a child process to be launched.
+ ///
+ /// @param[in] args
+ /// The command line to launch.
+ ///
+ /// @param[in] argc
+ /// The number of elements in the args array of cstring pointers.
+ ///
+ /// @param[in] launch_flags
+ /// The launch flags to use when launching this process.
+ ///
+ /// @return
+ /// An Error object indicating the success or failure of the
+ /// launch.
+ //------------------------------------------------------------------
+ lldb_private::Error
+ LaunchProcess (const char *const args[], int argc, unsigned int launch_flags);
+
protected:
lldb::thread_t m_async_thread;
lldb_private::ProcessLaunchInfo m_process_launch_info;
@@ -175,6 +198,9 @@ protected:
Handle_qKillSpawnedProcess (StringExtractorGDBRemote &packet);
PacketResult
+ Handle_k (StringExtractorGDBRemote &packet);
+
+ PacketResult
Handle_qPlatform_mkdir (StringExtractorGDBRemote &packet);
PacketResult
@@ -275,6 +301,9 @@ private:
int signal,
int status);
+ bool
+ KillSpawnedProcess (lldb::pid_t pid);
+
//------------------------------------------------------------------
// For GDBRemoteCommunicationServer only
//------------------------------------------------------------------
OpenPOWER on IntegriCloud