LLDB mainline
ScriptedProcessPythonInterface.h
Go to the documentation of this file.
1//===-- ScriptedProcessPythonInterface.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_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDPROCESSPYTHONINTERFACE_H
10#define LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDPROCESSPYTHONINTERFACE_H
11
13
15
16#include <optional>
17
18namespace lldb_private {
21 public PluginInterface {
22public:
24
25 llvm::Expected<StructuredData::GenericSP>
26 CreatePluginObject(const llvm::StringRef class_name,
27 ExecutionContext &exe_ctx,
29 StructuredData::Generic *script_obj = nullptr) override;
30
31 llvm::SmallVector<AbstractMethodRequirement>
33 return llvm::SmallVector<AbstractMethodRequirement>(
34 {{"read_memory_at_address", 4},
35 {"is_alive"},
36 {"get_scripted_thread_plugin"}});
37 }
38
40
41 Status Attach(const ProcessAttachInfo &attach_info) override;
42
43 Status Launch() override;
44
45 Status Resume() override;
46
47 std::optional<MemoryRegionInfo>
49 Status &error) override;
50
52
53 bool CreateBreakpoint(lldb::addr_t addr, Status &error) override;
54
56 Status &error) override;
57
60 Status &error) override;
61
63
64 lldb::pid_t GetProcessID() override;
65
66 bool IsAlive() override;
67
68 std::optional<std::string> GetScriptedThreadPluginName() override;
69
71
72 static void Initialize();
73
74 static void Terminate();
75
76 static llvm::StringRef GetPluginNameStatic() {
77 return "ScriptedProcessPythonInterface";
78 }
79
80 llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
81
82private:
84};
85} // namespace lldb_private
86
87#endif // LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDPROCESSPYTHONINTERFACE_H
static llvm::raw_ostream & error(Stream &strm)
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
StructuredData::DictionarySP GetThreadsInfo() override
llvm::Expected< StructuredData::GenericSP > CreatePluginObject(const llvm::StringRef class_name, ExecutionContext &exe_ctx, StructuredData::DictionarySP args_sp, StructuredData::Generic *script_obj=nullptr) override
lldb::ScriptedThreadInterfaceSP CreateScriptedThreadInterface() override
lldb::DataExtractorSP ReadMemoryAtAddress(lldb::addr_t address, size_t size, Status &error) override
std::optional< std::string > GetScriptedThreadPluginName() override
bool CreateBreakpoint(lldb::addr_t addr, Status &error) override
Status Attach(const ProcessAttachInfo &attach_info) override
std::optional< MemoryRegionInfo > GetMemoryRegionContainingAddress(lldb::addr_t address, Status &error) override
llvm::SmallVector< AbstractMethodRequirement > GetAbstractMethodRequirements() const override
lldb::offset_t WriteMemoryAtAddress(lldb::addr_t addr, lldb::DataExtractorSP data_sp, Status &error) override
ScriptedProcessPythonInterface(ScriptInterpreterPythonImpl &interpreter)
StructuredData::DictionarySP GetCapabilities() override
ScriptedPythonInterface(ScriptInterpreterPythonImpl &interpreter)
An error handling class.
Definition Status.h:118
std::shared_ptr< Dictionary > DictionarySP
std::shared_ptr< Array > ArraySP
A class that represents a running process on the host machine.
uint64_t offset_t
Definition lldb-types.h:85
std::shared_ptr< lldb_private::ScriptedThreadInterface > ScriptedThreadInterfaceSP
uint64_t pid_t
Definition lldb-types.h:83
uint64_t addr_t
Definition lldb-types.h:80
std::shared_ptr< lldb_private::DataExtractor > DataExtractorSP