diff options
author | Pavel Labath <labath@google.com> | 2018-05-14 16:54:53 +0000 |
---|---|---|
committer | Pavel Labath <labath@google.com> | 2018-05-14 16:54:53 +0000 |
commit | 4f107ba20e0b53f3ae38f69195c96c2a31bd4b34 (patch) | |
tree | 32faa161218f1d005c719917daef28f5cb3a92c0 /lldb/source/Host/common/MonitoringProcessLauncher.cpp | |
parent | 329c3e9a5ff791a892a130d8747f3b0111a30378 (diff) | |
download | bcm5719-llvm-4f107ba20e0b53f3ae38f69195c96c2a31bd4b34.tar.gz bcm5719-llvm-4f107ba20e0b53f3ae38f69195c96c2a31bd4b34.zip |
Revert "Remove Process references from the Host module"
The first fix wasn't enough, there is still a missing
ProcessInstanceInfo include in Host.mm. I won't be able to test a fix
before leaving work, so I am reverting both commits.
This reverts commit r332250 and the subsequent fix attempt.
llvm-svn: 332261
Diffstat (limited to 'lldb/source/Host/common/MonitoringProcessLauncher.cpp')
-rw-r--r-- | lldb/source/Host/common/MonitoringProcessLauncher.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/lldb/source/Host/common/MonitoringProcessLauncher.cpp b/lldb/source/Host/common/MonitoringProcessLauncher.cpp index 76c11454f57..efc10004b5f 100644 --- a/lldb/source/Host/common/MonitoringProcessLauncher.cpp +++ b/lldb/source/Host/common/MonitoringProcessLauncher.cpp @@ -9,6 +9,7 @@ #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" @@ -57,9 +58,18 @@ MonitoringProcessLauncher::LaunchProcess(const ProcessLaunchInfo &launch_info, if (process.GetProcessId() != LLDB_INVALID_PROCESS_ID) { Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS)); - assert(launch_info.GetMonitorProcessCallback()); - process.StartMonitoring(launch_info.GetMonitorProcessCallback(), - launch_info.GetMonitorSignals()); + 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); if (log) log->PutCString("started monitoring child process."); } else { |