|
LLDB mainline
|
Abstract interface for the Python script interpreter. More...
#include <ScriptInterpreterPython.h>
Classes | |
| class | CommandDataPython |
Public Member Functions | |
| ScriptInterpreterPython (Debugger &debugger) | |
| llvm::Expected< std::string > | ExtensionToImportPath (lldb::ScriptedExtension extension) override |
| StructuredData::DictionarySP | GetInterpreterInfo () override |
| llvm::Expected< FileSpec > | GenerateExtensionTemplate (const std::string &name, std::vector< ExtensionTemplateRequest > &extensions, bool generate_non_abstract_methods, std::string output_file) override |
| Public Member Functions inherited from lldb_private::ScriptInterpreter | |
| ScriptInterpreter (Debugger &debugger, lldb::ScriptLanguage script_lang) | |
| ~ScriptInterpreter () override=default | |
| virtual bool | Interrupt () |
| virtual bool | ExecuteOneLine (llvm::StringRef command, CommandReturnObject *result, const ExecuteScriptOptions &options=ExecuteScriptOptions())=0 |
| virtual void | ExecuteInterpreterLoop ()=0 |
| virtual bool | ExecuteOneLineWithReturn (llvm::StringRef in_string, ScriptReturnType return_type, void *ret_value, const ExecuteScriptOptions &options=ExecuteScriptOptions()) |
| virtual Status | ExecuteMultipleLines (const char *in_string, const ExecuteScriptOptions &options=ExecuteScriptOptions()) |
| virtual Status | ExportFunctionDefinitionToInterpreter (StringList &function_def) |
| virtual Status | GenerateBreakpointCommandCallbackData (StringList &input, std::string &output, bool has_extra_args, bool is_callback) |
| virtual bool | GenerateWatchpointCommandCallbackData (StringList &input, std::string &output, bool is_callback) |
| virtual bool | GenerateTypeScriptFunction (const char *oneliner, std::string &output, const void *name_token=nullptr) |
| virtual bool | GenerateTypeScriptFunction (StringList &input, std::string &output, const void *name_token=nullptr) |
| virtual bool | GenerateScriptAliasFunction (StringList &input, std::string &output) |
| virtual bool | GenerateTypeSynthClass (StringList &input, std::string &output, const void *name_token=nullptr) |
| virtual bool | GenerateTypeSynthClass (const char *oneliner, std::string &output, const void *name_token=nullptr) |
| virtual StructuredData::ObjectSP | LoadPluginModule (const FileSpec &file_spec, lldb_private::Status &error) |
| virtual StructuredData::DictionarySP | GetDynamicSettings (StructuredData::ObjectSP plugin_module_sp, Target *target, const char *setting_name, lldb_private::Status &error) |
| virtual Status | GenerateFunction (const char *signature, const StringList &input, bool is_callback) |
| virtual void | CollectDataForBreakpointCommandCallback (std::vector< std::reference_wrapper< BreakpointOptions > > &options, CommandReturnObject &result) |
| virtual void | CollectDataForWatchpointCommandCallback (WatchpointOptions *wp_options, CommandReturnObject &result) |
| Status | SetBreakpointCommandCallback (std::vector< std::reference_wrapper< BreakpointOptions > > &bp_options_vec, const char *callback_text) |
| Set the specified text as the callback for the breakpoint. | |
| virtual Status | SetBreakpointCommandCallback (BreakpointOptions &bp_options, const char *callback_text, bool is_callback) |
| virtual Status | SetBreakpointCommandCallback (BreakpointOptions &bp_options, std::unique_ptr< BreakpointOptions::CommandData > &data_up) |
| This one is for deserialization: | |
| Status | SetBreakpointCommandCallbackFunction (std::vector< std::reference_wrapper< BreakpointOptions > > &bp_options_vec, const char *function_name, StructuredData::ObjectSP extra_args_sp) |
| virtual Status | SetBreakpointCommandCallbackFunction (BreakpointOptions &bp_options, const char *function_name, StructuredData::ObjectSP extra_args_sp) |
| Set a script function as the callback for the breakpoint. | |
| virtual void | SetWatchpointCommandCallback (WatchpointOptions *wp_options, const char *user_input, bool is_callback) |
| Set a one-liner as the callback for the watchpoint. | |
| virtual bool | GetScriptedSummary (const char *function_name, lldb::ValueObjectSP valobj, StructuredData::ObjectSP &callee_wrapper_sp, const TypeSummaryOptions &options, std::string &retval) |
| virtual bool | FormatterCallbackFunction (const char *function_name, lldb::TypeImplSP type_impl_sp) |
| virtual void | Clear () |
| virtual bool | RunScriptBasedCommand (const char *impl_function, llvm::StringRef args, ScriptedCommandSynchronicity synchronicity, lldb_private::CommandReturnObject &cmd_retobj, Status &error, const lldb_private::ExecutionContext &exe_ctx) |
| virtual bool | RunScriptFormatKeyword (const char *impl_function, Process *process, std::string &output, Status &error) |
| virtual bool | RunScriptFormatKeyword (const char *impl_function, Thread *thread, std::string &output, Status &error) |
| virtual bool | RunScriptFormatKeyword (const char *impl_function, Target *target, std::string &output, Status &error) |
| virtual bool | RunScriptFormatKeyword (const char *impl_function, StackFrame *frame, std::string &output, Status &error) |
| virtual bool | RunScriptFormatKeyword (const char *impl_function, ValueObject *value, std::string &output, Status &error) |
| virtual bool | GetDocumentationForItem (const char *item, std::string &dest) |
| virtual bool | CheckObjectExists (const char *name) |
| virtual bool | LoadScriptingModule (const char *filename, const LoadScriptOptions &options, lldb_private::Status &error, StructuredData::ObjectSP *module_sp=nullptr, FileSpec extra_search_dir={}, lldb::TargetSP loaded_into_target_sp={}) |
| virtual bool | IsReservedWord (const char *word) |
| virtual std::unique_ptr< ScriptInterpreterLocker > | AcquireInterpreterLock () |
| const char * | GetScriptInterpreterPtyName () |
| virtual llvm::Expected< unsigned > | GetMaxPositionalArgumentsForCallable (const llvm::StringRef &callable_name) |
| lldb::ScriptLanguage | GetLanguage () |
| virtual lldb::ScriptedProcessInterfaceUP | CreateScriptedProcessInterface () |
| virtual lldb::ScriptedThreadInterfaceSP | CreateScriptedThreadInterface () |
| virtual lldb::ScriptedFrameInterfaceSP | CreateScriptedFrameInterface () |
| virtual lldb::ScriptedFrameProviderInterfaceSP | CreateScriptedFrameProviderInterface () |
| virtual lldb::ScriptedThreadPlanInterfaceSP | CreateScriptedThreadPlanInterface () |
| virtual lldb::OperatingSystemInterfaceSP | CreateOperatingSystemInterface () |
| virtual lldb::ScriptedPlatformInterfaceUP | GetScriptedPlatformInterface () |
| virtual lldb::ScriptedHookInterfaceSP | CreateScriptedHookInterface () |
| virtual lldb::ScriptedBreakpointInterfaceSP | CreateScriptedBreakpointInterface () |
| virtual lldb::ScriptedStackFrameRecognizerInterfaceSP | CreateScriptedStackFrameRecognizerInterface () |
| virtual lldb::ScriptedCommandInterfaceSP | CreateScriptedCommandInterface () |
| virtual lldb::ScriptedStringSummaryInterfaceSP | CreateScriptedStringSummaryInterface () |
| virtual lldb::ScriptedSyntheticChildrenInterfaceSP | CreateScriptedSyntheticChildrenInterface () |
| virtual StructuredData::ObjectSP | CreateStructuredDataFromScriptObject (ScriptObject obj) |
| virtual SanitizedScriptingModuleName | GetSanitizedScriptingModuleName (llvm::StringRef name) |
| Debugger & | GetDebugger () |
| Get the debugger associated with this script interpreter. | |
| const Debugger & | GetDebugger () const |
| Public Member Functions inherited from lldb_private::PluginInterface | |
| PluginInterface ()=default | |
| virtual | ~PluginInterface ()=default |
| virtual llvm::StringRef | GetPluginName ()=0 |
| PluginInterface (const PluginInterface &)=delete | |
| PluginInterface & | operator= (const PluginInterface &)=delete |
| Public Member Functions inherited from lldb_private::IOHandlerDelegateMultiline | |
| IOHandlerDelegateMultiline (llvm::StringRef end_line, Completion completion=Completion::None) | |
| ~IOHandlerDelegateMultiline () override=default | |
| llvm::StringRef | IOHandlerGetControlSequence (char ch) override |
| bool | IOHandlerIsInputComplete (IOHandler &io_handler, StringList &lines) override |
| Called to determine whether typing enter after the last line in lines should end input. | |
| Public Member Functions inherited from lldb_private::IOHandlerDelegate | |
| IOHandlerDelegate (Completion completion=Completion::None) | |
| virtual | ~IOHandlerDelegate ()=default |
| virtual void | IOHandlerActivated (IOHandler &io_handler, bool interactive) |
| virtual void | IOHandlerDeactivated (IOHandler &io_handler) |
| virtual std::optional< std::string > | IOHandlerSuggestion (IOHandler &io_handler, llvm::StringRef line) |
| virtual void | IOHandlerComplete (IOHandler &io_handler, CompletionRequest &request) |
| virtual const char * | IOHandlerGetFixIndentationCharacters () |
| virtual int | IOHandlerFixIndentation (IOHandler &io_handler, const StringList &lines, int cursor_position) |
| Called when a new line is created or one of an identified set of indentation characters is typed. | |
| virtual void | IOHandlerInputComplete (IOHandler &io_handler, std::string &data)=0 |
| Called when a line or lines have been retrieved. | |
| virtual void | IOHandlerInputInterrupted (IOHandler &io_handler, std::string &data) |
| virtual const char * | IOHandlerGetCommandPrefix () |
| virtual const char * | IOHandlerGetHelpPrologue () |
| virtual bool | IOHandlerInterrupt (IOHandler &io_handler) |
Static Public Member Functions | |
| static void | Initialize () |
| static void | Terminate () |
| static llvm::StringRef | GetPluginNameStatic () |
| static llvm::StringRef | GetPluginDescriptionStatic () |
| static FileSpec | GetPythonDir () |
| static void | SharedLibraryDirectoryHelper (FileSpec &this_file) |
| Static Public Member Functions inherited from lldb_private::ScriptInterpreter | |
| static std::string | LanguageToString (lldb::ScriptLanguage language) |
| static lldb::ScriptLanguage | StringToLanguage (const llvm::StringRef &string) |
| static llvm::StringLiteral | ExtensionToString (lldb::ScriptedExtension extension) |
| static lldb::ScriptedExtension | StringToExtension (llvm::StringRef string) |
Protected Member Functions | |
| 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) |
| llvm::Expected< StructuredData::ObjectSP > | GetExtensionSchema (const llvm::SmallVector< llvm::StringRef > &extension_path) |
Static Protected Member Functions | |
| static void | ComputePythonDirForApple (llvm::SmallVectorImpl< char > &path) |
| static void | ComputePythonDir (llvm::SmallVectorImpl< char > &path) |
Additional Inherited Members | |
| Public Types inherited from lldb_private::ScriptInterpreter | |
| enum | ScriptReturnType { eScriptReturnTypeCharPtr , eScriptReturnTypeBool , eScriptReturnTypeShortInt , eScriptReturnTypeShortIntUnsigned , eScriptReturnTypeInt , eScriptReturnTypeIntUnsigned , eScriptReturnTypeLongInt , eScriptReturnTypeLongIntUnsigned , eScriptReturnTypeLongLong , eScriptReturnTypeLongLongUnsigned , eScriptReturnTypeFloat , eScriptReturnTypeDouble , eScriptReturnTypeChar , eScriptReturnTypeCharStrOrNone , eScriptReturnTypeOpaqueObject } |
| Public Types inherited from lldb_private::IOHandlerDelegate | |
| enum class | Completion { None , LLDBCommand , Expression } |
| Protected Attributes inherited from lldb_private::ScriptInterpreter | |
| Debugger & | m_debugger |
| lldb::ScriptLanguage | m_script_lang |
| Protected Attributes inherited from lldb_private::IOHandlerDelegateMultiline | |
| const std::string | m_end_line |
| Protected Attributes inherited from lldb_private::IOHandlerDelegate | |
| Completion | m_completion |
Abstract interface for the Python script interpreter.
Definition at line 25 of file ScriptInterpreterPython.h.
|
inline |
Definition at line 41 of file ScriptInterpreterPython.h.
References lldb_private::IOHandlerDelegateMultiline::IOHandlerDelegateMultiline(), and lldb_private::ScriptInterpreter::ScriptInterpreter().
Referenced by lldb_private::ScriptInterpreterPythonImpl::ScriptInterpreterPythonImpl().
|
staticprotected |
Definition at line 206 of file ScriptInterpreterPython.cpp.
Referenced by ComputePythonDirForApple(), and GetPythonDir().
|
staticprotected |
Definition at line 190 of file ScriptInterpreterPython.cpp.
References ComputePythonDir().
Referenced by GetPythonDir().
|
overridevirtual |
Reimplemented from lldb_private::ScriptInterpreter.
Definition at line 270 of file ScriptInterpreterPython.cpp.
References lldb::eScriptedExtensionInvalid, lldb::eScriptedExtensionOperatingSystem, lldb::eScriptedExtensionParsedCommand, lldb::eScriptedExtensionScriptedBreakpointResolver, lldb::eScriptedExtensionScriptedCommand, lldb::eScriptedExtensionScriptedFrame, lldb::eScriptedExtensionScriptedFrameProvider, lldb::eScriptedExtensionScriptedHook, lldb::eScriptedExtensionScriptedPlatform, lldb::eScriptedExtensionScriptedProcess, lldb::eScriptedExtensionScriptedStackFrameRecognizer, lldb::eScriptedExtensionScriptedStringSummary, lldb::eScriptedExtensionScriptedSyntheticChildren, lldb::eScriptedExtensionScriptedThread, and lldb::eScriptedExtensionScriptedThreadPlan.
Referenced by GetExtensionSchema().
|
overridevirtual |
Reimplemented from lldb_private::ScriptInterpreter.
Definition at line 562 of file ScriptInterpreterPython.cpp.
References lldb_private::FileSpec::AppendPathComponent(), lldb_private::File::eOpenOptionCanCreate, lldb_private::File::eOpenOptionTruncate, lldb_private::File::eOpenOptionWriteOnly, error(), lldb_private::Stream::Format(), lldb_private::StreamString::GetData(), lldb_private::StreamString::GetSize(), lldb_private::StreamString::GetString(), lldb_private::FileSystem::Instance(), lldb_private::FileSystem::Open(), ParseExtensionSchema(), lldb_private::Stream::PutCString(), and lldb_private::FileSystem::Resolve().
|
protected |
Definition at line 306 of file ScriptInterpreterPython.cpp.
References lldb_private::ScriptInterpreter::eScriptReturnTypeOpaqueObject, lldb_private::ScriptInterpreter::ExecuteOneLineWithReturn(), ExtensionToImportPath(), lldb_private::ScriptInterpreter::ExtensionToString(), lldb_private::python::PythonObject::get(), lldb_private::StreamString::GetData(), lldb_private::python::PythonString::GetString(), lldb_private::python::PythonObject::IsAllocated(), lldb_private::python::Owned, lldb_private::StructuredData::ParseJSON(), lldb_private::Stream::Printf(), lldb_private::python::PythonObject::Str(), and lldb_private::ScriptInterpreter::StringToExtension().
Referenced by ParseExtensionSchema().
|
overridevirtual |
Reimplemented from lldb_private::ScriptInterpreter.
Definition at line 256 of file ScriptInterpreterPython.cpp.
References lldb_private::python::As(), GetInterpreterInfoScript, lldb_private::FileSpec::GetPath(), GetPythonDir(), python_exe_relative_path, and lldb_private::python::unwrapIgnoringErrors().
|
static |
Definition at line 661 of file ScriptInterpreterPython.cpp.
Referenced by Initialize().
|
inlinestatic |
Definition at line 56 of file ScriptInterpreterPython.h.
Referenced by lldb_private::ScriptInterpreterPythonImpl::GetPluginName(), and Initialize().
|
static |
Definition at line 221 of file ScriptInterpreterPython.cpp.
References ComputePythonDir(), ComputePythonDirForApple(), lldb_private::FileSpec::GetPath(), and lldb_private::FileSpec::SetDirectory().
Referenced by GetInterpreterInfo(), and Initialize().
|
static |
Definition at line 665 of file ScriptInterpreterPython.cpp.
References lldb_private::ScriptInterpreterPythonImpl::CreateInstance(), lldb::eScriptLanguagePython, GetPluginDescriptionStatic(), GetPluginNameStatic(), GetPythonDir(), lldb_private::ScriptInterpreterPythonImpl::Initialize(), lldb_private::ScriptInterpreterPythonInterfaces::Initialize(), lldb_private::PluginManager::RegisterPlugin(), and SharedLibraryDirectoryHelper().
|
protected |
Definition at line 360 of file ScriptInterpreterPython.cpp.
References lldb_private::Stream::EOL(), lldb_private::StructuredData::Array::ForEach(), lldb_private::StructuredData::Object::GetAsString(), GetExtensionSchema(), lldb_private::StructuredData::Array::GetItemAtIndexAsDictionary(), lldb_private::StructuredData::Array::GetSize(), lldb_private::StructuredData::Dictionary::GetValueForKeyAsArray(), lldb_private::StructuredData::Dictionary::GetValueForKeyAsBoolean(), lldb_private::StructuredData::Dictionary::GetValueForKeyAsString(), lldb_private::Stream::Indent(), lldb_private::Stream::IndentLess(), lldb_private::Stream::IndentMore(), lldb_private::Stream::Printf(), and lldb_private::Stream::PutCString().
Referenced by GenerateExtensionTemplate().
|
static |
Definition at line 634 of file ScriptInterpreterPython.cpp.
References lldb_private::FileSpec::AppendPathComponent(), lldb_private::FileSpec::GetFileNameExtension(), lldb_private::FileSystem::Instance(), lldb_private::FileSpec::RemoveLastPathComponent(), and lldb_private::FileSystem::ResolveSymbolicLink().
Referenced by Initialize().
|
static |
Definition at line 688 of file ScriptInterpreterPython.cpp.
References lldb_private::ScriptInterpreterPythonImpl::CreateInstance(), lldb_private::ScriptInterpreterPythonInterfaces::Terminate(), and lldb_private::PluginManager::UnregisterPlugin().