xref: /openbsd-src/gnu/llvm/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedProcessPythonInterface.h (revision f6aab3d83b51b91c24247ad2c2573574de475a82)
1be691f3bSpatrick //===-- ScriptedProcessPythonInterface.h ------------------------*- C++ -*-===//
2be691f3bSpatrick //
3be691f3bSpatrick // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4be691f3bSpatrick // See https://llvm.org/LICENSE.txt for license information.
5be691f3bSpatrick // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6be691f3bSpatrick //
7be691f3bSpatrick //===----------------------------------------------------------------------===//
8be691f3bSpatrick 
9be691f3bSpatrick #ifndef LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_SCRIPTEDPROCESSPYTHONINTERFACE_H
10be691f3bSpatrick #define LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_SCRIPTEDPROCESSPYTHONINTERFACE_H
11be691f3bSpatrick 
12be691f3bSpatrick #include "lldb/Host/Config.h"
13be691f3bSpatrick 
14be691f3bSpatrick #if LLDB_ENABLE_PYTHON
15be691f3bSpatrick 
16*f6aab3d8Srobert #include "ScriptedPythonInterface.h"
17be691f3bSpatrick #include "lldb/Interpreter/ScriptedProcessInterface.h"
18*f6aab3d8Srobert #include <optional>
19be691f3bSpatrick 
20be691f3bSpatrick namespace lldb_private {
21*f6aab3d8Srobert class ScriptedProcessPythonInterface : public ScriptedProcessInterface,
22*f6aab3d8Srobert                                        public ScriptedPythonInterface {
23be691f3bSpatrick public:
24*f6aab3d8Srobert   ScriptedProcessPythonInterface(ScriptInterpreterPythonImpl &interpreter);
25be691f3bSpatrick 
26be691f3bSpatrick   StructuredData::GenericSP
27*f6aab3d8Srobert   CreatePluginObject(const llvm::StringRef class_name,
28*f6aab3d8Srobert                      ExecutionContext &exe_ctx,
29*f6aab3d8Srobert                      StructuredData::DictionarySP args_sp,
30*f6aab3d8Srobert                      StructuredData::Generic *script_obj = nullptr) override;
31be691f3bSpatrick 
32be691f3bSpatrick   Status Launch() override;
33be691f3bSpatrick 
34be691f3bSpatrick   Status Resume() override;
35be691f3bSpatrick 
36be691f3bSpatrick   bool ShouldStop() override;
37be691f3bSpatrick 
38be691f3bSpatrick   Status Stop() override;
39be691f3bSpatrick 
40*f6aab3d8Srobert   std::optional<MemoryRegionInfo>
41*f6aab3d8Srobert   GetMemoryRegionContainingAddress(lldb::addr_t address,
42*f6aab3d8Srobert                                    Status &error) override;
43*f6aab3d8Srobert 
44*f6aab3d8Srobert   StructuredData::DictionarySP GetThreadsInfo() override;
45be691f3bSpatrick 
46be691f3bSpatrick   StructuredData::DictionarySP GetThreadWithID(lldb::tid_t tid) override;
47be691f3bSpatrick 
48be691f3bSpatrick   StructuredData::DictionarySP GetRegistersForThread(lldb::tid_t tid) override;
49be691f3bSpatrick 
50be691f3bSpatrick   lldb::DataExtractorSP ReadMemoryAtAddress(lldb::addr_t address, size_t size,
51be691f3bSpatrick                                             Status &error) override;
52be691f3bSpatrick 
53*f6aab3d8Srobert   StructuredData::ArraySP GetLoadedImages() override;
54be691f3bSpatrick 
55be691f3bSpatrick   lldb::pid_t GetProcessID() override;
56be691f3bSpatrick 
57be691f3bSpatrick   bool IsAlive() override;
58be691f3bSpatrick 
59*f6aab3d8Srobert   std::optional<std::string> GetScriptedThreadPluginName() override;
60*f6aab3d8Srobert 
61*f6aab3d8Srobert   StructuredData::DictionarySP GetMetadata() override;
62be691f3bSpatrick 
63be691f3bSpatrick private:
64*f6aab3d8Srobert   lldb::ScriptedThreadInterfaceSP CreateScriptedThreadInterface() override;
65be691f3bSpatrick };
66be691f3bSpatrick } // namespace lldb_private
67be691f3bSpatrick 
68be691f3bSpatrick #endif // LLDB_ENABLE_PYTHON
69be691f3bSpatrick #endif // LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_SCRIPTEDPROCESSPYTHONINTERFACE_H
70