LLDB mainline
|
#include <ScriptInterpreterLua.h>
Classes | |
class | CommandDataLua |
Public Member Functions | |
ScriptInterpreterLua (Debugger &debugger) | |
~ScriptInterpreterLua () override | |
bool | ExecuteOneLine (llvm::StringRef command, CommandReturnObject *result, const ExecuteScriptOptions &options=ExecuteScriptOptions()) override |
void | ExecuteInterpreterLoop () override |
bool | LoadScriptingModule (const char *filename, const LoadScriptOptions &options, lldb_private::Status &error, StructuredData::ObjectSP *module_sp=nullptr, FileSpec extra_search_dir={}) override |
StructuredData::DictionarySP | GetInterpreterInfo () override |
llvm::StringRef | GetPluginName () override |
Lua & | GetLua () |
llvm::Error | EnterSession (lldb::user_id_t debugger_id) |
llvm::Error | LeaveSession () |
void | CollectDataForBreakpointCommandCallback (std::vector< std::reference_wrapper< BreakpointOptions > > &bp_options_vec, CommandReturnObject &result) override |
void | CollectDataForWatchpointCommandCallback (WatchpointOptions *wp_options, CommandReturnObject &result) override |
Status | SetBreakpointCommandCallback (BreakpointOptions &bp_options, const char *command_body_text, bool is_callback) override |
void | SetWatchpointCommandCallback (WatchpointOptions *wp_options, const char *command_body_text, bool is_callback) override |
Set a one-liner as the callback for the watchpoint. | |
Status | SetBreakpointCommandCallbackFunction (BreakpointOptions &bp_options, const char *function_name, StructuredData::ObjectSP extra_args_sp) override |
Set a script function as the callback for the breakpoint. | |
![]() | |
ScriptInterpreter (Debugger &debugger, lldb::ScriptLanguage script_lang, lldb::ScriptedPlatformInterfaceUP scripted_platform_interface_up=std::make_unique< ScriptedPlatformInterface >()) | |
virtual StructuredData::DictionarySP | GetInterpreterInfo () |
~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 | CreateSyntheticScriptedProvider (const char *class_name, lldb::ValueObjectSP valobj) |
virtual StructuredData::GenericSP | CreateScriptCommandObject (const char *class_name) |
virtual StructuredData::GenericSP | CreateFrameRecognizer (const char *class_name) |
virtual lldb::ValueObjectListSP | GetRecognizedArguments (const StructuredData::ObjectSP &implementor, lldb::StackFrameSP frame_sp) |
virtual StructuredData::GenericSP | OSPlugin_CreatePluginObject (const char *class_name, lldb::ProcessSP process_sp) |
virtual StructuredData::DictionarySP | OSPlugin_RegisterInfo (StructuredData::ObjectSP os_plugin_object_sp) |
virtual StructuredData::ArraySP | OSPlugin_ThreadsInfo (StructuredData::ObjectSP os_plugin_object_sp) |
virtual StructuredData::StringSP | OSPlugin_RegisterContextData (StructuredData::ObjectSP os_plugin_object_sp, lldb::tid_t thread_id) |
virtual StructuredData::DictionarySP | OSPlugin_CreateThread (StructuredData::ObjectSP os_plugin_object_sp, lldb::tid_t tid, lldb::addr_t context) |
virtual StructuredData::ObjectSP | CreateScriptedThreadPlan (const char *class_name, const StructuredDataImpl &args_data, std::string &error_str, lldb::ThreadPlanSP thread_plan_sp) |
virtual bool | ScriptedThreadPlanExplainsStop (StructuredData::ObjectSP implementor_sp, Event *event, bool &script_error) |
virtual bool | ScriptedThreadPlanShouldStop (StructuredData::ObjectSP implementor_sp, Event *event, bool &script_error) |
virtual bool | ScriptedThreadPlanIsStale (StructuredData::ObjectSP implementor_sp, bool &script_error) |
virtual lldb::StateType | ScriptedThreadPlanGetRunState (StructuredData::ObjectSP implementor_sp, bool &script_error) |
virtual StructuredData::GenericSP | CreateScriptedBreakpointResolver (const char *class_name, const StructuredDataImpl &args_data, lldb::BreakpointSP &bkpt_sp) |
virtual bool | ScriptedBreakpointResolverSearchCallback (StructuredData::GenericSP implementor_sp, SymbolContext *sym_ctx) |
virtual lldb::SearchDepth | ScriptedBreakpointResolverSearchDepth (StructuredData::GenericSP implementor_sp) |
virtual StructuredData::GenericSP | CreateScriptedStopHook (lldb::TargetSP target_sp, const char *class_name, const StructuredDataImpl &args_data, Status &error) |
virtual bool | ScriptedStopHookHandleStop (StructuredData::GenericSP implementor_sp, ExecutionContext &exc_ctx, lldb::StreamSP stream_sp) |
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 size_t | CalculateNumChildren (const StructuredData::ObjectSP &implementor, uint32_t max) |
virtual lldb::ValueObjectSP | GetChildAtIndex (const StructuredData::ObjectSP &implementor, uint32_t idx) |
virtual int | GetIndexOfChildWithName (const StructuredData::ObjectSP &implementor, const char *child_name) |
virtual bool | UpdateSynthProviderInstance (const StructuredData::ObjectSP &implementor) |
virtual bool | MightHaveChildrenSynthProviderInstance (const StructuredData::ObjectSP &implementor) |
virtual lldb::ValueObjectSP | GetSyntheticValue (const StructuredData::ObjectSP &implementor) |
virtual ConstString | GetSyntheticTypeName (const StructuredData::ObjectSP &implementor) |
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 | RunScriptBasedCommand (StructuredData::GenericSP impl_obj_sp, 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 | GetShortHelpForCommandObject (StructuredData::GenericSP cmd_obj_sp, std::string &dest) |
virtual uint32_t | GetFlagsForCommandObject (StructuredData::GenericSP cmd_obj_sp) |
virtual bool | GetLongHelpForCommandObject (StructuredData::GenericSP cmd_obj_sp, 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={}) |
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 () |
ScriptedPlatformInterface & | GetScriptedPlatformInterface () |
lldb::DataExtractorSP | GetDataExtractorFromSBData (const lldb::SBData &data) const |
Status | GetStatusFromSBError (const lldb::SBError &error) const |
lldb::ProcessAttachInfoSP | GetOpaqueTypeFromSBAttachInfo (const lldb::SBAttachInfo &attach_info) const |
lldb::ProcessLaunchInfoSP | GetOpaqueTypeFromSBLaunchInfo (const lldb::SBLaunchInfo &launch_info) const |
std::optional< MemoryRegionInfo > | GetOpaqueTypeFromSBMemoryRegionInfo (const lldb::SBMemoryRegionInfo &mem_region) const |
![]() | |
PluginInterface ()=default | |
virtual | ~PluginInterface ()=default |
virtual llvm::StringRef | GetPluginName ()=0 |
PluginInterface (const PluginInterface &)=delete | |
PluginInterface & | operator= (const PluginInterface &)=delete |
Static Public Member Functions | |
static void | Initialize () |
static void | Terminate () |
static lldb::ScriptInterpreterSP | CreateInstance (Debugger &debugger) |
static llvm::StringRef | GetPluginNameStatic () |
static llvm::StringRef | GetPluginDescriptionStatic () |
static bool | BreakpointCallbackFunction (void *baton, StoppointCallbackContext *context, lldb::user_id_t break_id, lldb::user_id_t break_loc_id) |
static bool | WatchpointCallbackFunction (void *baton, StoppointCallbackContext *context, lldb::user_id_t watch_id) |
![]() | |
static std::string | LanguageToString (lldb::ScriptLanguage language) |
static lldb::ScriptLanguage | StringToLanguage (const llvm::StringRef &string) |
Private Member Functions | |
Status | RegisterBreakpointCallback (BreakpointOptions &bp_options, const char *command_body_text, StructuredData::ObjectSP extra_args_sp) |
Status | RegisterWatchpointCallback (WatchpointOptions *wp_options, const char *command_body_text, StructuredData::ObjectSP extra_args_sp) |
Private Attributes | |
std::unique_ptr< Lua > | m_lua |
bool | m_session_is_active = false |
Additional Inherited Members | |
![]() | |
enum | ScriptReturnType { eScriptReturnTypeCharPtr , eScriptReturnTypeBool , eScriptReturnTypeShortInt , eScriptReturnTypeShortIntUnsigned , eScriptReturnTypeInt , eScriptReturnTypeIntUnsigned , eScriptReturnTypeLongInt , eScriptReturnTypeLongIntUnsigned , eScriptReturnTypeLongLong , eScriptReturnTypeLongLongUnsigned , eScriptReturnTypeFloat , eScriptReturnTypeDouble , eScriptReturnTypeChar , eScriptReturnTypeCharStrOrNone , eScriptReturnTypeOpaqueObject } |
![]() | |
Debugger & | m_debugger |
lldb::ScriptLanguage | m_script_lang |
lldb::ScriptedPlatformInterfaceUP | m_scripted_platform_interface_up |
Definition at line 22 of file ScriptInterpreterLua.h.
ScriptInterpreterLua::ScriptInterpreterLua | ( | Debugger & | debugger | ) |
Definition at line 146 of file ScriptInterpreterLua.cpp.
|
overridedefault |
|
static |
Definition at line 268 of file ScriptInterpreterLua.cpp.
References lldb_private::Lua::CallBreakpointCallback(), lldb::eScriptLanguageLua, lldb_private::StoppointCallbackContext::exe_ctx_ref, lldb_private::Target::GetBreakpointByID(), lldb_private::Target::GetDebugger(), lldb_private::Debugger::GetErrorStream(), lldb_private::ExecutionContext::GetFrameSP(), GetLua(), lldb_private::Debugger::GetScriptInterpreter(), lldb_private::ExecutionContext::GetTargetPtr(), lldb_private::ScriptInterpreterLua::CommandDataLua::m_extra_args_sp, and lldb_private::toString().
Referenced by RegisterBreakpointCallback().
|
overridevirtual |
Reimplemented from lldb_private::ScriptInterpreter.
Definition at line 325 of file ScriptInterpreterLua.cpp.
References eIOHandlerBreakpoint, lldb_private::ScriptInterpreter::m_debugger, and lldb_private::Debugger::RunIOHandlerAsync().
|
overridevirtual |
Reimplemented from lldb_private::ScriptInterpreter.
Definition at line 334 of file ScriptInterpreterLua.cpp.
References eIOHandlerWatchpoint, lldb_private::ScriptInterpreter::m_debugger, and lldb_private::Debugger::RunIOHandlerAsync().
|
static |
Definition at line 394 of file ScriptInterpreterLua.cpp.
Referenced by Initialize().
llvm::Error ScriptInterpreterLua::EnterSession | ( | lldb::user_id_t | debugger_id | ) |
Definition at line 241 of file ScriptInterpreterLua.cpp.
References m_lua, and m_session_is_active.
Referenced by IOHandlerLuaInterpreter::IOHandlerLuaInterpreter().
|
overridevirtual |
Implements lldb_private::ScriptInterpreter.
Definition at line 201 of file ScriptInterpreterLua.cpp.
References lldb_private::Debugger::GetInputFile(), lldb_private::File::IsValid(), LLDB_SCOPED_TIMER, lldb_private::ScriptInterpreter::m_debugger, and lldb_private::Debugger::RunIOHandlerAsync().
|
overridevirtual |
Implements lldb_private::ScriptInterpreter.
Definition at line 158 of file ScriptInterpreterLua.cpp.
References lldb_private::CommandReturnObject::AppendError(), lldb_private::CommandReturnObject::AppendErrorWithFormatv(), lldb_private::ScriptInterpreterIORedirect::Create(), lldb_private::ScriptInterpreterIORedirect::Flush(), lldb_private::ExecuteScriptOptions::GetEnableIO(), lldb_private::ScriptInterpreterIORedirect::GetErrorFile(), lldb_private::ScriptInterpreterIORedirect::GetOutputFile(), lldb_private::ScriptInterpreter::m_debugger, and m_lua.
|
overridevirtual |
Reimplemented from lldb_private::ScriptInterpreter.
Definition at line 152 of file ScriptInterpreterLua.cpp.
Lua & ScriptInterpreterLua::GetLua | ( | ) |
Definition at line 402 of file ScriptInterpreterLua.cpp.
References m_lua.
Referenced by BreakpointCallbackFunction(), IOHandlerLuaInterpreter::IOHandlerInputComplete(), IOHandlerLuaInterpreter::IOHandlerIsInputComplete(), IOHandlerLuaInterpreter::IOHandlerLuaInterpreter(), and WatchpointCallbackFunction().
|
static |
Definition at line 398 of file ScriptInterpreterLua.cpp.
Referenced by Initialize().
|
inlineoverridevirtual |
Implements lldb_private::PluginInterface.
Definition at line 75 of file ScriptInterpreterLua.h.
References GetPluginNameStatic().
|
inlinestatic |
Definition at line 61 of file ScriptInterpreterLua.h.
Referenced by GetPluginName(), and Initialize().
|
static |
Definition at line 229 of file ScriptInterpreterLua.cpp.
References CreateInstance(), lldb::eScriptLanguageLua, GetPluginDescriptionStatic(), GetPluginNameStatic(), and lldb_private::PluginManager::RegisterPlugin().
llvm::Error ScriptInterpreterLua::LeaveSession | ( | ) |
Definition at line 254 of file ScriptInterpreterLua.cpp.
References m_lua, and m_session_is_active.
Referenced by IOHandlerLuaInterpreter::~IOHandlerLuaInterpreter().
|
overridevirtual |
Reimplemented from lldb_private::ScriptInterpreter.
Definition at line 216 of file ScriptInterpreterLua.cpp.
|
private |
Definition at line 357 of file ScriptInterpreterLua.cpp.
References BreakpointCallbackFunction(), error(), m_lua, and lldb_private::BreakpointOptions::SetCallback().
Referenced by SetBreakpointCommandCallback(), and SetBreakpointCommandCallbackFunction().
|
private |
Definition at line 378 of file ScriptInterpreterLua.cpp.
References error(), m_lua, lldb_private::WatchpointOptions::SetCallback(), and WatchpointCallbackFunction().
Referenced by SetWatchpointCommandCallback().
|
overridevirtual |
Reimplemented from lldb_private::ScriptInterpreter.
Definition at line 351 of file ScriptInterpreterLua.cpp.
References RegisterBreakpointCallback().
Referenced by IOHandlerLuaInterpreter::IOHandlerInputComplete().
|
overridevirtual |
Set a script function as the callback for the breakpoint.
Reimplemented from lldb_private::ScriptInterpreter.
Definition at line 342 of file ScriptInterpreterLua.cpp.
References RegisterBreakpointCallback().
|
overridevirtual |
Set a one-liner as the callback for the watchpoint.
Reimplemented from lldb_private::ScriptInterpreter.
Definition at line 372 of file ScriptInterpreterLua.cpp.
References RegisterWatchpointCallback().
Referenced by IOHandlerLuaInterpreter::IOHandlerInputComplete().
|
static |
Definition at line 239 of file ScriptInterpreterLua.cpp.
|
static |
Definition at line 298 of file ScriptInterpreterLua.cpp.
References lldb_private::Lua::CallWatchpointCallback(), lldb::eScriptLanguageLua, lldb_private::StoppointCallbackContext::exe_ctx_ref, lldb_private::WatchpointList::FindByID(), lldb_private::Target::GetDebugger(), lldb_private::Debugger::GetErrorStream(), lldb_private::ExecutionContext::GetFrameSP(), GetLua(), lldb_private::Debugger::GetScriptInterpreter(), lldb_private::ExecutionContext::GetTargetPtr(), lldb_private::Target::GetWatchpointList(), and lldb_private::toString().
Referenced by RegisterWatchpointCallback().
|
private |
Definition at line 103 of file ScriptInterpreterLua.h.
Referenced by EnterSession(), ExecuteOneLine(), GetLua(), LeaveSession(), LoadScriptingModule(), RegisterBreakpointCallback(), and RegisterWatchpointCallback().
|
private |
Definition at line 104 of file ScriptInterpreterLua.h.
Referenced by EnterSession(), and LeaveSession().