1 //===-- HostNativeProcessBase.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_HOSTNATIVEPROCESSBASE_H
10 #define LLDB_HOST_HOSTNATIVEPROCESSBASE_H
11 
12 #include "lldb/Host/HostProcess.h"
13 #include "lldb/Utility/Status.h"
14 #include "lldb/lldb-defines.h"
15 #include "lldb/lldb-types.h"
16 
17 namespace lldb_private {
18 
19 class HostThread;
20 
21 class HostNativeProcessBase {
22   HostNativeProcessBase(const HostNativeProcessBase &) = delete;
23   const HostNativeProcessBase &
24   operator=(const HostNativeProcessBase &) = delete;
25 
26 public:
27   HostNativeProcessBase() : m_process(LLDB_INVALID_PROCESS) {}
28   explicit HostNativeProcessBase(lldb::process_t process)
29       : m_process(process) {}
30   virtual ~HostNativeProcessBase() {}
31 
32   virtual Status Terminate() = 0;
33   virtual Status GetMainModule(FileSpec &file_spec) const = 0;
34 
35   virtual lldb::pid_t GetProcessId() const = 0;
36   virtual bool IsRunning() const = 0;
37 
38   lldb::process_t GetSystemHandle() const { return m_process; }
39 
40   virtual llvm::Expected<HostThread>
41   StartMonitoring(const Host::MonitorChildProcessCallback &callback,
42                   bool monitor_signals) = 0;
43 
44 protected:
45   lldb::process_t m_process;
46 };
47 }
48 
49 #endif
50