diff options
author | Pavel Labath <labath@google.com> | 2018-05-14 15:13:13 +0000 |
---|---|---|
committer | Pavel Labath <labath@google.com> | 2018-05-14 15:13:13 +0000 |
commit | 58b54894c7b66a565e9dcf5236ff1425ab8053dc (patch) | |
tree | e88eaf8b251c89f72084bf4650f0b46883eaec65 /lldb/source/Host/common/MonitoringProcessLauncher.cpp | |
parent | 8ea3a34e390fd6b5a5754ab28a455cfac04e324b (diff) | |
download | bcm5719-llvm-58b54894c7b66a565e9dcf5236ff1425ab8053dc.tar.gz bcm5719-llvm-58b54894c7b66a565e9dcf5236ff1425ab8053dc.zip |
Remove Process references from the Host module
The Process class was only being referenced because of the last-ditch
effort in the process launchers to set a process death callback in case
one isn't set already.
Although launching a process for debugging is the most important kind of
"launch" we are doing, it is by far not the only one, so assuming this
particular callback is the one to be used is not a good idea (besides
breaking layering). Instead of assuming a particular exit callback, I
change the launcher code to require the callback to be set by the user (and fix
up the two call sites which did not set the callback already).
Reviewers: jingham, davide
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D46395
llvm-svn: 332250
Diffstat (limited to 'lldb/source/Host/common/MonitoringProcessLauncher.cpp')
-rw-r--r-- | lldb/source/Host/common/MonitoringProcessLauncher.cpp | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/lldb/source/Host/common/MonitoringProcessLauncher.cpp b/lldb/source/Host/common/MonitoringProcessLauncher.cpp index efc10004b5f..76c11454f57 100644 --- a/lldb/source/Host/common/MonitoringProcessLauncher.cpp +++ b/lldb/source/Host/common/MonitoringProcessLauncher.cpp @@ -9,7 +9,6 @@ #include "lldb/Host/MonitoringProcessLauncher.h" #include "lldb/Host/HostProcess.h" -#include "lldb/Target/Process.h" #include "lldb/Target/ProcessLaunchInfo.h" #include "lldb/Utility/Log.h" #include "lldb/Utility/Status.h" @@ -58,18 +57,9 @@ MonitoringProcessLauncher::LaunchProcess(const ProcessLaunchInfo &launch_info, if (process.GetProcessId() != LLDB_INVALID_PROCESS_ID) { Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS)); - Host::MonitorChildProcessCallback callback = - launch_info.GetMonitorProcessCallback(); - - bool monitor_signals = false; - if (callback) { - // If the ProcessLaunchInfo specified a callback, use that. - monitor_signals = launch_info.GetMonitorSignals(); - } else { - callback = Process::SetProcessExitStatus; - } - - process.StartMonitoring(callback, monitor_signals); + assert(launch_info.GetMonitorProcessCallback()); + process.StartMonitoring(launch_info.GetMonitorProcessCallback(), + launch_info.GetMonitorSignals()); if (log) log->PutCString("started monitoring child process."); } else { |