summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/macosx
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2018-05-14 15:13:13 +0000
committerPavel Labath <labath@google.com>2018-05-14 15:13:13 +0000
commit58b54894c7b66a565e9dcf5236ff1425ab8053dc (patch)
treee88eaf8b251c89f72084bf4650f0b46883eaec65 /lldb/source/Host/macosx
parent8ea3a34e390fd6b5a5754ab28a455cfac04e324b (diff)
downloadbcm5719-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/macosx')
-rw-r--r--lldb/source/Host/macosx/Host.mm14
1 files changed, 4 insertions, 10 deletions
diff --git a/lldb/source/Host/macosx/Host.mm b/lldb/source/Host/macosx/Host.mm
index d87c6be915c..c2aea0afb88 100644
--- a/lldb/source/Host/macosx/Host.mm
+++ b/lldb/source/Host/macosx/Host.mm
@@ -57,7 +57,6 @@
#include "lldb/Host/ConnectionFileDescriptor.h"
#include "lldb/Host/HostInfo.h"
#include "lldb/Host/ThreadLauncher.h"
-#include "lldb/Target/Process.h"
#include "lldb/Utility/ArchSpec.h"
#include "lldb/Utility/CleanUp.h"
#include "lldb/Utility/DataBufferHeap.h"
@@ -68,6 +67,7 @@
#include "lldb/Utility/NameMatches.h"
#include "lldb/Utility/StreamString.h"
#include "lldb/Utility/StructuredData.h"
+#include "lldb/lldb-defines.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Errno.h"
@@ -1497,15 +1497,9 @@ Status Host::LaunchProcess(ProcessLaunchInfo &launch_info) {
launch_info.SetProcessID(pid);
// Make sure we reap any processes we spawn or we will have zombies.
- if (!launch_info.MonitorProcess()) {
- const bool monitor_signals = false;
- Host::MonitorChildProcessCallback callback = nullptr;
-
- if (!launch_info.GetFlags().Test(lldb::eLaunchFlagDontSetExitStatus))
- callback = Process::SetProcessExitStatus;
-
- StartMonitoringChildProcess(callback, pid, monitor_signals);
- }
+ bool monitoring = launch_info.MonitorProcess());
+ UNUSED_IF_ASSERT_DISABLED(monitoring);
+ assert(monitoring);
} else {
// Invalid process ID, something didn't go well
if (error.Success())
OpenPOWER on IntegriCloud