LLDB  mainline
HostProcess.cpp
Go to the documentation of this file.
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 
11 #include "lldb/Host/HostThread.h"
12 
13 using namespace lldb;
14 using namespace lldb_private;
15 
16 HostProcess::HostProcess() : m_native_process(new HostNativeProcess) {}
17 
19  : m_native_process(new HostNativeProcess(process)) {}
20 
22 
24 
26  return m_native_process->GetMainModule(file_spec);
27 }
28 
30  return m_native_process->GetProcessId();
31 }
32 
33 bool HostProcess::IsRunning() const { return m_native_process->IsRunning(); }
34 
35 llvm::Expected<HostThread>
37  bool monitor_signals) {
38  return m_native_process->StartMonitoring(callback, monitor_signals);
39 }
40 
42  return *m_native_process;
43 }
44 
46  return *m_native_process;
47 }
A class that represents a running process on the host machine.
uint64_t process_t
Definition: lldb-types.h:57
A file utility class.
Definition: FileSpec.h:56
llvm::Expected< HostThread > StartMonitoring(const Host::MonitorChildProcessCallback &callback, bool monitor_signals)
Definition: HostProcess.cpp:36
std::shared_ptr< HostNativeProcessBase > m_native_process
Definition: HostProcess.h:53
Definition: SBAddress.h:15
Status GetMainModule(FileSpec &file_spec) const
Definition: HostProcess.cpp:25
uint64_t pid_t
Definition: lldb-types.h:85
std::function< bool(lldb::pid_t pid, bool exited, int signal, int status)> MonitorChildProcessCallback
Definition: Host.h:68
lldb::pid_t GetProcessId() const
Definition: HostProcess.cpp:29
HostNativeProcessBase & GetNativeProcess()
Definition: HostProcess.cpp:41
An error handling class.
Definition: Status.h:44