12c1f46dcSZachary Turner //===-- ScriptInterpreterPython.h -------------------------------*- C++ -*-===//
22c1f46dcSZachary Turner //
32946cd70SChandler Carruth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
42946cd70SChandler Carruth // See https://llvm.org/LICENSE.txt for license information.
52946cd70SChandler Carruth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
62c1f46dcSZachary Turner //
72c1f46dcSZachary Turner //===----------------------------------------------------------------------===//
82c1f46dcSZachary Turner 
92c1f46dcSZachary Turner #ifndef LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_SCRIPTINTERPRETERPYTHON_H
102c1f46dcSZachary Turner #define LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_SCRIPTINTERPRETERPYTHON_H
112c1f46dcSZachary Turner 
12d68983e3SPavel Labath #ifdef LLDB_DISABLE_PYTHON
13d68983e3SPavel Labath 
14d68983e3SPavel Labath // Python is disabled in this build
15d68983e3SPavel Labath 
16d68983e3SPavel Labath #else
17d68983e3SPavel Labath 
1863dd5d25SJonas Devlieghere #include "lldb/Breakpoint/BreakpointOptions.h"
1963dd5d25SJonas Devlieghere #include "lldb/Core/IOHandler.h"
2063dd5d25SJonas Devlieghere #include "lldb/Interpreter/ScriptInterpreter.h"
2163dd5d25SJonas Devlieghere #include "lldb/lldb-private.h"
2263dd5d25SJonas Devlieghere 
23edb35d95SEugene Zelenko #include <memory>
24edb35d95SEugene Zelenko #include <string>
25edb35d95SEugene Zelenko #include <vector>
26edb35d95SEugene Zelenko 
272c1f46dcSZachary Turner namespace lldb_private {
2863dd5d25SJonas Devlieghere /// Abstract interface for the Python script interpreter.
29b9c1b51eSKate Stone class ScriptInterpreterPython : public ScriptInterpreter,
30b9c1b51eSKate Stone                                 public IOHandlerDelegateMultiline {
312c1f46dcSZachary Turner public:
32f7e07256SJim Ingham   class CommandDataPython : public BreakpointOptions::CommandData {
33f7e07256SJim Ingham   public:
34f7e07256SJim Ingham     CommandDataPython() : BreakpointOptions::CommandData() {
35f7e07256SJim Ingham       interpreter = lldb::eScriptLanguagePython;
36f7e07256SJim Ingham     }
37f7e07256SJim Ingham   };
38f7e07256SJim Ingham 
39*8d1fb843SJonas Devlieghere   ScriptInterpreterPython(Debugger &debugger)
40*8d1fb843SJonas Devlieghere       : ScriptInterpreter(debugger, lldb::eScriptLanguagePython),
4163dd5d25SJonas Devlieghere         IOHandlerDelegateMultiline("DONE") {}
422c1f46dcSZachary Turner 
43b9c1b51eSKate Stone   static void Initialize();
44b9c1b51eSKate Stone   static void Terminate();
45b9c1b51eSKate Stone   static lldb_private::ConstString GetPluginNameStatic();
46b9c1b51eSKate Stone   static const char *GetPluginDescriptionStatic();
472df331b0SPavel Labath   static FileSpec GetPythonDir();
482df331b0SPavel Labath 
492c1f46dcSZachary Turner protected:
502df331b0SPavel Labath   static void ComputePythonDirForApple(llvm::SmallVectorImpl<char> &path);
512df331b0SPavel Labath   static void ComputePythonDirForPosix(llvm::SmallVectorImpl<char> &path);
522df331b0SPavel Labath   static void ComputePythonDirForWindows(llvm::SmallVectorImpl<char> &path);
532c1f46dcSZachary Turner };
542c1f46dcSZachary Turner } // namespace lldb_private
552c1f46dcSZachary Turner 
56d68983e3SPavel Labath #endif // LLDB_DISABLE_PYTHON
57280eb8abSPavel Labath #endif // LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_SCRIPTINTERPRETERPYTHON_H
58