]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - include/lldb/Host/HostProcess.h
Vendor import of lldb trunk r290819:
[FreeBSD/FreeBSD.git] / include / lldb / Host / HostProcess.h
1 //===-- HostProcess.h ------------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef lldb_Host_HostProcess_h_
11 #define lldb_Host_HostProcess_h_
12
13 #include "lldb/Host/Host.h"
14 #include "lldb/lldb-types.h"
15
16 //----------------------------------------------------------------------
17 /// @class HostInfo HostInfo.h "lldb/Host/HostProcess.h"
18 /// @brief A class that represents a running process on the host machine.
19 ///
20 /// HostProcess allows querying and manipulation of processes running on the
21 /// host machine.  It is not intended to be represent a process which is
22 /// being debugged, although the native debug engine of a platform may likely
23 /// back inferior processes by a HostProcess.
24 ///
25 /// HostProcess is implemented using static polymorphism so that on any given
26 /// platform, an instance of HostProcess will always be able to bind statically
27 /// to the concrete Process implementation for that platform.  See HostInfo
28 /// for more details.
29 ///
30 //----------------------------------------------------------------------
31
32 namespace lldb_private {
33
34 class HostNativeProcessBase;
35 class HostThread;
36
37 class HostProcess {
38 public:
39   HostProcess();
40   HostProcess(lldb::process_t process);
41   ~HostProcess();
42
43   Error Terminate();
44   Error GetMainModule(FileSpec &file_spec) const;
45
46   lldb::pid_t GetProcessId() const;
47   bool IsRunning() const;
48
49   HostThread StartMonitoring(const Host::MonitorChildProcessCallback &callback,
50                              bool monitor_signals);
51
52   HostNativeProcessBase &GetNativeProcess();
53   const HostNativeProcessBase &GetNativeProcess() const;
54
55 private:
56   std::shared_ptr<HostNativeProcessBase> m_native_process;
57 };
58 }
59
60 #endif