xref: /freebsd/contrib/llvm-project/lldb/source/Host/common/HostProcess.cpp (revision 81ad626541db97eb356e2c1d4a20eb2a26a766ab)
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()16 HostProcess::HostProcess() : m_native_process(new HostNativeProcess) {}
17 
HostProcess(lldb::process_t process)18 HostProcess::HostProcess(lldb::process_t process)
19     : m_native_process(new HostNativeProcess(process)) {}
20 
21 HostProcess::~HostProcess() = default;
22 
Terminate()23 Status HostProcess::Terminate() { return m_native_process->Terminate(); }
24 
GetProcessId() const25 lldb::pid_t HostProcess::GetProcessId() const {
26   return m_native_process->GetProcessId();
27 }
28 
IsRunning() const29 bool HostProcess::IsRunning() const { return m_native_process->IsRunning(); }
30 
StartMonitoring(const Host::MonitorChildProcessCallback & callback)31 llvm::Expected<HostThread> HostProcess::StartMonitoring(
32     const Host::MonitorChildProcessCallback &callback) {
33   return m_native_process->StartMonitoring(callback);
34 }
35 
GetNativeProcess()36 HostNativeProcessBase &HostProcess::GetNativeProcess() {
37   return *m_native_process;
38 }
39 
GetNativeProcess() const40 const HostNativeProcessBase &HostProcess::GetNativeProcess() const {
41   return *m_native_process;
42 }
43