1 //===-- HostProcess.cpp -----------------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #include "lldb/Host/HostProcess.h"
10 #include "lldb/Host/HostNativeProcess.h"
11 #include "lldb/Host/HostThread.h"
14 using namespace lldb_private;
16 HostProcess::HostProcess() : m_native_process(new HostNativeProcess) {}
18 HostProcess::HostProcess(lldb::process_t process)
19 : m_native_process(new HostNativeProcess(process)) {}
21 HostProcess::~HostProcess() {}
23 Status HostProcess::Terminate() { return m_native_process->Terminate(); }
25 Status HostProcess::GetMainModule(FileSpec &file_spec) const {
26 return m_native_process->GetMainModule(file_spec);
29 lldb::pid_t HostProcess::GetProcessId() const {
30 return m_native_process->GetProcessId();
33 bool HostProcess::IsRunning() const { return m_native_process->IsRunning(); }
35 llvm::Expected<HostThread>
36 HostProcess::StartMonitoring(const Host::MonitorChildProcessCallback &callback,
37 bool monitor_signals) {
38 return m_native_process->StartMonitoring(callback, monitor_signals);
41 HostNativeProcessBase &HostProcess::GetNativeProcess() {
42 return *m_native_process;
45 const HostNativeProcessBase &HostProcess::GetNativeProcess() const {
46 return *m_native_process;