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_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDPROCESSPYTHONINTERFACE_H
10#define LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDPROCESSPYTHONINTERFACE_H
11
12#include "lldb/Host/Config.h"
13
14#if LLDB_ENABLE_PYTHON
15
18#include <optional>
19
20namespace lldb_private {
21class ScriptedProcessPythonInterface : public ScriptedProcessInterface,
22 public ScriptedPythonInterface {
23public:
24 ScriptedProcessPythonInterface(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 {"read_memory_at_address", "is_alive", "get_scripted_thread_plugin"});
35 }
36
37 StructuredData::DictionarySP GetCapabilities() override;
38
39 Status Attach(const ProcessAttachInfo &attach_info) override;
40
41 Status Launch() override;
42
43 Status Resume() override;
44
45 std::optional<MemoryRegionInfo>
46 GetMemoryRegionContainingAddress(lldb::addr_t address,
47 Status &error) override;
48
49 StructuredData::DictionarySP GetThreadsInfo() override;
50
51 bool CreateBreakpoint(lldb::addr_t addr, Status &error) override;
52
53 lldb::DataExtractorSP ReadMemoryAtAddress(lldb::addr_t address, size_t size,
54 Status &error) override;
55
56 lldb::offset_t WriteMemoryAtAddress(lldb::addr_t addr,
58 Status &error) override;
59
60 StructuredData::ArraySP GetLoadedImages() override;
61
62 lldb::pid_t GetProcessID() override;
63
64 bool IsAlive() override;
65
66 std::optional<std::string> GetScriptedThreadPluginName() override;
67
68 StructuredData::DictionarySP GetMetadata() override;
69
70private:
71 lldb::ScriptedThreadInterfaceSP CreateScriptedThreadInterface() override;
72};
73} // namespace lldb_private
74
75#endif // LLDB_ENABLE_PYTHON
76#endif // LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDPROCESSPYTHONINTERFACE_H
static llvm::raw_ostream & error(Stream &strm)
A class that represents a running process on the host machine.
Definition: SBAttachInfo.h:14
uint64_t offset_t
Definition: lldb-types.h:83
std::shared_ptr< lldb_private::ScriptedThreadInterface > ScriptedThreadInterfaceSP
Definition: lldb-forward.h:405
uint64_t pid_t
Definition: lldb-types.h:81
uint64_t addr_t
Definition: lldb-types.h:79
std::shared_ptr< lldb_private::DataExtractor > DataExtractorSP
Definition: lldb-forward.h:330