LLDB mainline
ScriptedPlatformPythonInterface.h
Go to the documentation of this file.
1//===-- ScriptedPlatformPythonInterface.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_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDPLATFORMPYTHONINTERFACE_H
10#define LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDPLATFORMPYTHONINTERFACE_H
11
12#include "lldb/Host/Config.h"
14
15#if LLDB_ENABLE_PYTHON
16
18
19namespace lldb_private {
20class ScriptedPlatformPythonInterface : public ScriptedPlatformInterface,
21 public ScriptedPythonInterface,
22 public PluginInterface {
23public:
24 ScriptedPlatformPythonInterface(ScriptInterpreterPythonImpl &interpreter);
25
26 llvm::Expected<StructuredData::GenericSP>
27 CreatePluginObject(const llvm::StringRef class_name,
28 ExecutionContext &exe_ctx,
29 StructuredData::DictionarySP args_sp,
30 StructuredData::Generic *script_obj = nullptr) override;
31
32 llvm::SmallVector<llvm::StringLiteral> GetAbstractMethods() const override {
33 return llvm::SmallVector<llvm::StringLiteral>(
34 {"list_processes", "attach_to_process", "launch_process",
35 "kill_process"});
36 }
37
38 StructuredData::DictionarySP ListProcesses() override;
39
40 StructuredData::DictionarySP GetProcessInfo(lldb::pid_t) override;
41
43
44 Status LaunchProcess(lldb::ProcessLaunchInfoSP launch_info) override;
45
46 Status KillProcess(lldb::pid_t pid) override;
47
48 static void Initialize();
49
50 static void Terminate();
51
52 static llvm::StringRef GetPluginNameStatic() {
53 return "ScriptedPlatformPythonInterface";
54 }
55
56 llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
57};
58} // namespace lldb_private
59
60#endif // LLDB_ENABLE_PYTHON
61#endif // LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDPLATFORMPYTHONINTERFACE_H
static Status AttachToProcess(ProcessAttachInfo &attach_info, Target &target)
Definition: SBTarget.cpp:77
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::ProcessAttachInfo > ProcessAttachInfoSP
Definition: lldb-forward.h:388
uint64_t pid_t
Definition: lldb-types.h:83
std::shared_ptr< lldb_private::ProcessLaunchInfo > ProcessLaunchInfoSP
Definition: lldb-forward.h:389