LLDB  mainline
HostProcess.h
Go to the documentation of this file.
1 //===-- HostProcess.h ------------------------------------------*- C++ -*-===//
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 #ifndef lldb_Host_HostProcess_h_
10 #define lldb_Host_HostProcess_h_
11 
12 #include "lldb/Host/Host.h"
13 #include "lldb/lldb-types.h"
14 
15 /// \class HostInfo HostInfo.h "lldb/Host/HostProcess.h"
16 /// A class that represents a running process on the host machine.
17 ///
18 /// HostProcess allows querying and manipulation of processes running on the
19 /// host machine. It is not intended to be represent a process which is being
20 /// debugged, although the native debug engine of a platform may likely back
21 /// inferior processes by a HostProcess.
22 ///
23 /// HostProcess is implemented using static polymorphism so that on any given
24 /// platform, an instance of HostProcess will always be able to bind
25 /// statically to the concrete Process implementation for that platform. See
26 /// HostInfo for more details.
27 ///
28 
29 namespace lldb_private {
30 
31 class HostNativeProcessBase;
32 class HostThread;
33 
34 class HostProcess {
35 public:
36  HostProcess();
38  ~HostProcess();
39 
40  Status Terminate();
41  Status GetMainModule(FileSpec &file_spec) const;
42 
43  lldb::pid_t GetProcessId() const;
44  bool IsRunning() const;
45 
47  bool monitor_signals);
48 
51 
52 private:
53  std::shared_ptr<HostNativeProcessBase> m_native_process;
54 };
55 }
56 
57 #endif
Enumerations for broadcasting.
Definition: SBLaunchInfo.h:14
uint64_t process_t
Definition: lldb-types.h:57
A file utility class.
Definition: FileSpec.h:55
HostThread StartMonitoring(const Host::MonitorChildProcessCallback &callback, bool monitor_signals)
Definition: HostProcess.cpp:36
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