blob: 642c63443c20c379d2c13d1e3c6f0d7a361ccf35 [file] [log] [blame]
Andrew Walbran3d2c1972020-04-07 12:24:26 +01001//===-- 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
Olivier Deprezf4ef2d02021-04-20 13:36:24 +02009#ifndef LLDB_HOST_HOSTNATIVEPROCESSBASE_H
10#define LLDB_HOST_HOSTNATIVEPROCESSBASE_H
Andrew Walbran3d2c1972020-04-07 12:24:26 +010011
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
17namespace lldb_private {
18
19class HostThread;
20
21class HostNativeProcessBase {
Olivier Deprezf4ef2d02021-04-20 13:36:24 +020022 HostNativeProcessBase(const HostNativeProcessBase &) = delete;
23 const HostNativeProcessBase &
24 operator=(const HostNativeProcessBase &) = delete;
Andrew Walbran3d2c1972020-04-07 12:24:26 +010025
26public:
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
44protected:
45 lldb::process_t m_process;
46};
47}
48
49#endif