Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:42:49

0001 //===-- HostProcess.h ------------------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLDB_HOST_HOSTPROCESS_H
0010 #define LLDB_HOST_HOSTPROCESS_H
0011 
0012 #include "lldb/Host/Host.h"
0013 #include "lldb/lldb-types.h"
0014 
0015 /// A class that represents a running process on the host machine.
0016 ///
0017 /// HostProcess allows querying and manipulation of processes running on the
0018 /// host machine.  It is not intended to be represent a process which is being
0019 /// debugged, although the native debug engine of a platform may likely back
0020 /// inferior processes by a HostProcess.
0021 ///
0022 /// HostProcess is implemented using static polymorphism so that on any given
0023 /// platform, an instance of HostProcess will always be able to bind
0024 /// statically to the concrete Process implementation for that platform.  See
0025 /// HostInfo for more details.
0026 ///
0027 
0028 namespace lldb_private {
0029 
0030 class HostNativeProcessBase;
0031 class HostThread;
0032 
0033 class HostProcess {
0034 public:
0035   HostProcess();
0036   HostProcess(lldb::process_t process);
0037   ~HostProcess();
0038 
0039   Status Terminate();
0040 
0041   lldb::pid_t GetProcessId() const;
0042   bool IsRunning() const;
0043 
0044   llvm::Expected<HostThread>
0045   StartMonitoring(const Host::MonitorChildProcessCallback &callback);
0046 
0047   HostNativeProcessBase &GetNativeProcess();
0048   const HostNativeProcessBase &GetNativeProcess() const;
0049 
0050 private:
0051   std::shared_ptr<HostNativeProcessBase> m_native_process;
0052 };
0053 }
0054 
0055 #endif