diff options
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 { |