brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.3 KiB · a0da1bb Raw
65 lines · c
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-exception6//7//===----------------------------------------------------------------------===//8 9#ifndef LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDPLATFORMPYTHONINTERFACE_H10#define LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDPLATFORMPYTHONINTERFACE_H11 12#include "lldb/Host/Config.h"13#include "lldb/Interpreter/Interfaces/ScriptedPlatformInterface.h"14 15#if LLDB_ENABLE_PYTHON16 17#include "ScriptedPythonInterface.h"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<AbstractMethodRequirement>33  GetAbstractMethodRequirements() const override {34    return llvm::SmallVector<AbstractMethodRequirement>(35        {{"list_processes"},36         {"attach_to_process", 2},37         {"launch_process", 2},38         {"kill_process", 2}});39  }40 41  StructuredData::DictionarySP ListProcesses() override;42 43  StructuredData::DictionarySP GetProcessInfo(lldb::pid_t) override;44 45  Status AttachToProcess(lldb::ProcessAttachInfoSP attach_info) override;46 47  Status LaunchProcess(lldb::ProcessLaunchInfoSP launch_info) override;48 49  Status KillProcess(lldb::pid_t pid) override;50 51  static void Initialize();52 53  static void Terminate();54 55  static llvm::StringRef GetPluginNameStatic() {56    return "ScriptedPlatformPythonInterface";57  }58 59  llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }60};61} // namespace lldb_private62 63#endif // LLDB_ENABLE_PYTHON64#endif // LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDPLATFORMPYTHONINTERFACE_H65