Path: blob/main/contrib/llvm-project/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h
39638 views
//===-- ScriptInterpreterPython.h -------------------------------*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#ifndef LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_SCRIPTINTERPRETERPYTHON_H9#define LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_SCRIPTINTERPRETERPYTHON_H1011#include "lldb/Host/Config.h"1213#if LLDB_ENABLE_PYTHON1415#include "lldb/Breakpoint/BreakpointOptions.h"16#include "lldb/Core/IOHandler.h"17#include "lldb/Core/StructuredDataImpl.h"18#include "lldb/Interpreter/ScriptInterpreter.h"19#include "lldb/lldb-private.h"2021#include <memory>22#include <string>23#include <vector>2425namespace lldb_private {26/// Abstract interface for the Python script interpreter.27class ScriptInterpreterPython : public ScriptInterpreter,28public IOHandlerDelegateMultiline {29public:30class CommandDataPython : public BreakpointOptions::CommandData {31public:32CommandDataPython() : BreakpointOptions::CommandData() {33interpreter = lldb::eScriptLanguagePython;34}35CommandDataPython(StructuredData::ObjectSP extra_args_sp)36: BreakpointOptions::CommandData(),37m_extra_args(std::move(extra_args_sp)) {38interpreter = lldb::eScriptLanguagePython;39}40StructuredDataImpl m_extra_args;41};4243ScriptInterpreterPython(Debugger &debugger)44: ScriptInterpreter(debugger, lldb::eScriptLanguagePython),45IOHandlerDelegateMultiline("DONE") {}4647StructuredData::DictionarySP GetInterpreterInfo() override;48static void Initialize();49static void Terminate();50static llvm::StringRef GetPluginNameStatic() { return "script-python"; }51static llvm::StringRef GetPluginDescriptionStatic();52static FileSpec GetPythonDir();53static void SharedLibraryDirectoryHelper(FileSpec &this_file);5455protected:56static void ComputePythonDirForApple(llvm::SmallVectorImpl<char> &path);57static void ComputePythonDir(llvm::SmallVectorImpl<char> &path);58};59} // namespace lldb_private6061#endif // LLDB_ENABLE_PYTHON62#endif // LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_SCRIPTINTERPRETERPYTHON_H636465