diff options
author | Todd Fiala <tfiala@google.com> | 2014-01-24 00:52:53 +0000 |
---|---|---|
committer | Todd Fiala <tfiala@google.com> | 2014-01-24 00:52:53 +0000 |
commit | 3e92a2b013c320ed2b2f6fc183a023fb3b657869 (patch) | |
tree | c704e6de166ca9cfcce1e6d07813ac7ae1184791 /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h | |
parent | 74ca0c41059aa918f0de8aeb1fd65a34129fcba5 (diff) | |
download | bcm5719-llvm-3e92a2b013c320ed2b2f6fc183a023fb3b657869.tar.gz bcm5719-llvm-3e92a2b013c320ed2b2f6fc183a023fb3b657869.zip |
Added reaper for commandline-launched processes.
GDBRemoteCommunicationServer::LaunchProcess () now uses the built-up
ProcessLaunchArgs rather than clearing and setting items from the
function arguments. I added setters for the arguments and launch
flags, which lldb-gdbserver uses for its specification of the
commandline-specified startup app (if one is specified).
LaunchProcess () also adds a new reaper monitor that it applies to
the launched process if no process monitor has already been applied.
This addresses an issue where the 'k' command would generate (possibly
false) warnings about not being able to positively state whether a
killed process actually terminated. GDBRemoteCommunicationServer now
definitely knows the disposition of its children.
llvm-svn: 199959
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h | 44 |
1 files changed, 39 insertions, 5 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h index c1223ad0a34..6085016665d 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h @@ -139,11 +139,9 @@ public: } //------------------------------------------------------------------ - /// Launch a process. + /// Specify the program to launch and its arguments. /// - /// 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. + /// The LaunchProcess () command can be executed to do the lauching. /// /// @param[in] args /// The command line to launch. @@ -151,15 +149,41 @@ public: /// @param[in] argc /// The number of elements in the args array of cstring pointers. /// + /// @return + /// An Error object indicating the success or failure of making + /// the setting. + //------------------------------------------------------------------ + lldb_private::Error + SetLaunchArguments (const char *const args[], int argc); + + //------------------------------------------------------------------ + /// Specify the launch flags for the process. + /// + /// The LaunchProcess () command can be executed to do the lauching. + /// /// @param[in] launch_flags /// The launch flags to use when launching this process. /// /// @return + /// An Error object indicating the success or failure of making + /// the setting. + //------------------------------------------------------------------ + lldb_private::Error + SetLaunchFlags (unsigned int launch_flags); + + //------------------------------------------------------------------ + /// Launch a process with the current launch settings. + /// + /// 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. + /// + /// @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); + LaunchProcess (); protected: lldb::thread_t m_async_thread; @@ -302,6 +326,16 @@ private: int status); bool + DebuggedProcessReaped (lldb::pid_t pid); + + static bool + ReapDebuggedProcess (void *callback_baton, + lldb::pid_t pid, + bool exited, + int signal, + int status); + + bool KillSpawnedProcess (lldb::pid_t pid); //------------------------------------------------------------------ |