LLDB mainline
ScriptInterpreterPython.h
Go to the documentation of this file.
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_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_SCRIPTINTERPRETERPYTHON_H
10#define LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_SCRIPTINTERPRETERPYTHON_H
11
13#include "lldb/Core/IOHandler.h"
16#include "lldb/lldb-private.h"
17
18#include <memory>
19#include <set>
20#include <string>
21#include <vector>
22
23namespace lldb_private {
24/// Abstract interface for the Python script interpreter.
27public:
40
42 : ScriptInterpreter(debugger, lldb::eScriptLanguagePython),
44
45 llvm::Expected<std::string>
48 llvm::Expected<FileSpec>
49 GenerateExtensionTemplate(const std::string &name,
50 std::vector<ExtensionTemplateRequest> &extensions,
51 bool generate_non_abstract_methods,
52 std::string output_file) override;
53
54 static void Initialize();
55 static void Terminate();
56 static llvm::StringRef GetPluginNameStatic() { return "script-python"; }
57 static llvm::StringRef GetPluginDescriptionStatic();
58 static FileSpec GetPythonDir();
59 static void SharedLibraryDirectoryHelper(FileSpec &this_file);
60
61protected:
62 llvm::Error
63 ParseExtensionSchema(Stream &s, llvm::StringRef output_script_prefix,
64 const llvm::SmallVector<llvm::StringRef> &extension_path,
65 bool generate_non_abstract_methods,
66 std::set<std::string> &typing_imports);
67 llvm::Expected<StructuredData::ObjectSP>
68 GetExtensionSchema(const llvm::SmallVector<llvm::StringRef> &extension_path);
69
72};
73} // namespace lldb_private
74
75#endif // LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_SCRIPTINTERPRETERPYTHON_H
"lldb/Breakpoint/BreakpointOptions.h" Class that manages the options on a breakpoint or breakpoint lo...
A class to manage flag bits.
Definition Debugger.h:100
A file utility class.
Definition FileSpec.h:57
IOHandlerDelegateMultiline(llvm::StringRef end_line, Completion completion=Completion::None)
Definition IOHandler.h:289
static void ComputePythonDir(llvm::SmallVectorImpl< char > &path)
static void ComputePythonDirForApple(llvm::SmallVectorImpl< char > &path)
llvm::Expected< StructuredData::ObjectSP > GetExtensionSchema(const llvm::SmallVector< llvm::StringRef > &extension_path)
StructuredData::DictionarySP GetInterpreterInfo() override
llvm::Error ParseExtensionSchema(Stream &s, llvm::StringRef output_script_prefix, const llvm::SmallVector< llvm::StringRef > &extension_path, bool generate_non_abstract_methods, std::set< std::string > &typing_imports)
static void SharedLibraryDirectoryHelper(FileSpec &this_file)
llvm::Expected< std::string > ExtensionToImportPath(lldb::ScriptedExtension extension) override
llvm::Expected< FileSpec > GenerateExtensionTemplate(const std::string &name, std::vector< ExtensionTemplateRequest > &extensions, bool generate_non_abstract_methods, std::string output_file) override
ScriptInterpreter(Debugger &debugger, lldb::ScriptLanguage script_lang)
A stream class that can stream formatted output to a file.
Definition Stream.h:28
std::shared_ptr< Dictionary > DictionarySP
std::shared_ptr< Object > ObjectSP
A class that represents a running process on the host machine.
@ eScriptLanguagePython
ScriptedExtension
Scripting extension types.