1 //===-- HostProcess.cpp ---------------------------------------------------===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 #include "lldb/Host/HostProcess.h" 10 #include "lldb/Host/HostNativeProcess.h" 11 #include "lldb/Host/HostThread.h" 12 13 using namespace lldb; 14 using namespace lldb_private; 15 HostProcess()16HostProcess::HostProcess() : m_native_process(new HostNativeProcess) {} 17 HostProcess(lldb::process_t process)18HostProcess::HostProcess(lldb::process_t process) 19 : m_native_process(new HostNativeProcess(process)) {} 20 21 HostProcess::~HostProcess() = default; 22 Terminate()23Status HostProcess::Terminate() { return m_native_process->Terminate(); } 24 GetMainModule(FileSpec & file_spec) const25Status HostProcess::GetMainModule(FileSpec &file_spec) const { 26 return m_native_process->GetMainModule(file_spec); 27 } 28 GetProcessId() const29lldb::pid_t HostProcess::GetProcessId() const { 30 return m_native_process->GetProcessId(); 31 } 32 IsRunning() const33bool HostProcess::IsRunning() const { return m_native_process->IsRunning(); } 34 35 llvm::Expected<HostThread> StartMonitoring(const Host::MonitorChildProcessCallback & callback,bool monitor_signals)36HostProcess::StartMonitoring(const Host::MonitorChildProcessCallback &callback, 37 bool monitor_signals) { 38 return m_native_process->StartMonitoring(callback, monitor_signals); 39 } 40 GetNativeProcess()41HostNativeProcessBase &HostProcess::GetNativeProcess() { 42 return *m_native_process; 43 } 44 GetNativeProcess() const45const HostNativeProcessBase &HostProcess::GetNativeProcess() const { 46 return *m_native_process; 47 } 48