1 //===-- HostProcess.cpp -----------------------------------------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 #include "lldb/Host/HostProcess.h" 11 #include "lldb/Host/HostNativeProcess.h" 12 #include "lldb/Host/HostThread.h" 13 14 using namespace lldb; 15 using namespace lldb_private; 16 17 HostProcess::HostProcess() : m_native_process(new HostNativeProcess) {} 18 19 HostProcess::HostProcess(lldb::process_t process) 20 : m_native_process(new HostNativeProcess(process)) {} 21 22 HostProcess::~HostProcess() {} 23 24 Error HostProcess::Terminate() { return m_native_process->Terminate(); } 25 26 Error HostProcess::GetMainModule(FileSpec &file_spec) const { 27 return m_native_process->GetMainModule(file_spec); 28 } 29 30 lldb::pid_t HostProcess::GetProcessId() const { 31 return m_native_process->GetProcessId(); 32 } 33 34 bool HostProcess::IsRunning() const { return m_native_process->IsRunning(); } 35 36 HostThread 37 HostProcess::StartMonitoring(const Host::MonitorChildProcessCallback &callback, 38 bool monitor_signals) { 39 return m_native_process->StartMonitoring(callback, monitor_signals); 40 } 41 42 HostNativeProcessBase &HostProcess::GetNativeProcess() { 43 return *m_native_process; 44 } 45 46 const HostNativeProcessBase &HostProcess::GetNativeProcess() const { 47 return *m_native_process; 48 } 49