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_SCRIPTEDPROCESSPYTHONINTERFACE_H
10 #define LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_SCRIPTEDPROCESSPYTHONINTERFACE_H
11 
12 #include "lldb/Host/Config.h"
13 
14 #if LLDB_ENABLE_PYTHON
15 
16 #include "ScriptedPythonInterface.h"
17 #include "lldb/Interpreter/ScriptedProcessInterface.h"
18 
19 namespace lldb_private {
20 class ScriptedProcessPythonInterface : public ScriptedProcessInterface,
21                                        public ScriptedPythonInterface {
22 public:
23   ScriptedProcessPythonInterface(ScriptInterpreterPythonImpl &interpreter);
24 
25   StructuredData::GenericSP
26   CreatePluginObject(const llvm::StringRef class_name,
27                      ExecutionContext &exe_ctx,
28                      StructuredData::DictionarySP args_sp) override;
29 
30   Status Launch() override;
31 
32   Status Resume() override;
33 
34   bool ShouldStop() override;
35 
36   Status Stop() override;
37 
38   llvm::Optional<MemoryRegionInfo>
39   GetMemoryRegionContainingAddress(lldb::addr_t address,
40                                    Status &error) override;
41 
42   StructuredData::DictionarySP GetThreadWithID(lldb::tid_t tid) override;
43 
44   StructuredData::DictionarySP GetRegistersForThread(lldb::tid_t tid) override;
45 
46   lldb::DataExtractorSP ReadMemoryAtAddress(lldb::addr_t address, size_t size,
47                                             Status &error) override;
48 
49   StructuredData::DictionarySP GetLoadedImages() override;
50 
51   lldb::pid_t GetProcessID() override;
52 
53   bool IsAlive() override;
54 
55   llvm::Optional<std::string> GetScriptedThreadPluginName() override;
56 
57 private:
58   lldb::ScriptedThreadInterfaceSP GetScriptedThreadInterface() override;
59 };
60 } // namespace lldb_private
61 
62 #endif // LLDB_ENABLE_PYTHON
63 #endif // LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_SCRIPTEDPROCESSPYTHONINTERFACE_H
64