]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm-project/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h
MFC r355940:
[FreeBSD/FreeBSD.git] / contrib / llvm-project / lldb / source / Plugins / ScriptInterpreter / Python / ScriptInterpreterPython.h
1 //===-- ScriptInterpreterPython.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_SCRIPTINTERPRETERPYTHON_H
10 #define LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_SCRIPTINTERPRETERPYTHON_H
11
12 #ifdef LLDB_DISABLE_PYTHON
13
14 // Python is disabled in this build
15
16 #else
17
18 #include "lldb/Breakpoint/BreakpointOptions.h"
19 #include "lldb/Core/IOHandler.h"
20 #include "lldb/Interpreter/ScriptInterpreter.h"
21 #include "lldb/lldb-private.h"
22
23 #include <memory>
24 #include <string>
25 #include <vector>
26
27 namespace lldb_private {
28 /// Abstract interface for the Python script interpreter.
29 class ScriptInterpreterPython : public ScriptInterpreter,
30                                 public IOHandlerDelegateMultiline {
31 public:
32   class CommandDataPython : public BreakpointOptions::CommandData {
33   public:
34     CommandDataPython() : BreakpointOptions::CommandData() {
35       interpreter = lldb::eScriptLanguagePython;
36     }
37   };
38
39   ScriptInterpreterPython(Debugger &debugger)
40       : ScriptInterpreter(debugger, lldb::eScriptLanguagePython),
41         IOHandlerDelegateMultiline("DONE") {}
42
43   static void Initialize();
44   static void Terminate();
45   static lldb_private::ConstString GetPluginNameStatic();
46   static const char *GetPluginDescriptionStatic();
47   static FileSpec GetPythonDir();
48
49 protected:
50   static void ComputePythonDirForApple(llvm::SmallVectorImpl<char> &path);
51   static void ComputePythonDirForPosix(llvm::SmallVectorImpl<char> &path);
52   static void ComputePythonDirForWindows(llvm::SmallVectorImpl<char> &path);
53 };
54 } // namespace lldb_private
55
56 #endif // LLDB_DISABLE_PYTHON
57 #endif // LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_SCRIPTINTERPRETERPYTHON_H