9#ifndef LLDB_INTERPRETER_SCRIPTINTERPRETER_H
10#define LLDB_INTERPRETER_SCRIPTINTERPRETER_H
108 static llvm::Expected<std::unique_ptr<ScriptInterpreterIORedirect>>
122 std::unique_ptr<File> output);
155 std::make_unique<ScriptedPlatformInterface>());
176 const char *in_string,
179 error.SetErrorString(
"not implemented");
186 error.SetErrorString(
"not implemented");
195 error.SetErrorString(
"not implemented");
207 const void *name_token =
nullptr) {
213 const void *name_token =
nullptr) {
218 std::string &output) {
223 const void *name_token =
nullptr) {
228 const void *name_token =
nullptr) {
285 std::string &error_str,
292 Event *event,
bool &script_error) {
299 Event *event,
bool &script_error) {
306 bool &script_error) {
313 bool &script_error) {
321 bool &script_error) {
349 error.SetErrorString(
"Creating scripted stop-hooks with the current "
350 "script interpreter is not supported.");
378 error.SetErrorString(
"unimplemented");
383 std::vector<std::reference_wrapper<BreakpointOptions>> &options,
392 std::vector<std::reference_wrapper<BreakpointOptions>> &bp_options_vec,
393 const char *callback_text);
396 const char *callback_text,
399 error.SetErrorString(
"unimplemented");
406 std::unique_ptr<BreakpointOptions::CommandData> &data_up) {
408 error.SetErrorString(
"unimplemented");
413 std::vector<std::reference_wrapper<BreakpointOptions>> &bp_options_vec,
419 const char *function_name,
422 error.SetErrorString(
"unimplemented");
428 const char *user_input,
435 std::string &retval) {
464 const char *child_name) {
506 Process *process, std::string &output,
508 error.SetErrorString(
"unimplemented");
514 error.SetErrorString(
"unimplemented");
520 error.SetErrorString(
"unimplemented");
527 error.SetErrorString(
"unimplemented");
534 error.SetErrorString(
"unimplemented");
575 virtual llvm::Expected<unsigned>
577 return llvm::createStringError(
578 llvm::inconvertibleErrorCode(),
"Unimplemented function");
588 return std::make_unique<ScriptedProcessInterface>();
static llvm::raw_ostream & error(Stream &strm)
"lldb/Breakpoint/BreakpointOptions.h" Class that manages the options on a breakpoint or breakpoint lo...
A uniqued constant string class.
A class to manage flag bits.
bool GetSetLLDBGlobals() const
bool GetMaskoutErrors() const
ExecuteScriptOptions & SetMaskoutErrors(bool maskout)
ExecuteScriptOptions & SetSetLLDBGlobals(bool set)
ExecuteScriptOptions & SetEnableIO(bool enable)
ExecuteScriptOptions()=default
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
bool GetInitSession() const
LoadScriptOptions & SetInitSession(bool b)
LoadScriptOptions & SetSilent(bool b)
LoadScriptOptions()=default
A plug-in interface definition class for debugging a process.
lldb::FileSP GetOutputFile() const
lldb::StreamFileSP m_error_file_sp
lldb::FileSP m_input_file_sp
ThreadedCommunication m_communication
lldb::StreamFileSP m_output_file_sp
lldb::FileSP GetErrorFile() const
~ScriptInterpreterIORedirect()
void Flush()
Flush our output and error file handles.
lldb::FileSP GetInputFile() const
static llvm::Expected< std::unique_ptr< ScriptInterpreterIORedirect > > Create(bool enable_io, Debugger &debugger, CommandReturnObject *result)
Create an IO redirect.
ScriptInterpreterLocker()=default
const ScriptInterpreterLocker & operator=(const ScriptInterpreterLocker &)=delete
ScriptInterpreterLocker(const ScriptInterpreterLocker &)=delete
virtual ~ScriptInterpreterLocker()=default
static lldb::ScriptLanguage StringToLanguage(const llvm::StringRef &string)
virtual void CollectDataForBreakpointCommandCallback(std::vector< std::reference_wrapper< BreakpointOptions > > &options, CommandReturnObject &result)
virtual lldb::ValueObjectListSP GetRecognizedArguments(const StructuredData::ObjectSP &implementor, lldb::StackFrameSP frame_sp)
const char * GetScriptInterpreterPtyName()
lldb::ProcessAttachInfoSP GetOpaqueTypeFromSBAttachInfo(const lldb::SBAttachInfo &attach_info) const
virtual Status ExecuteMultipleLines(const char *in_string, const ExecuteScriptOptions &options=ExecuteScriptOptions())
virtual bool LoadScriptingModule(const char *filename, const LoadScriptOptions &options, lldb_private::Status &error, StructuredData::ObjectSP *module_sp=nullptr, FileSpec extra_search_dir={})
virtual StructuredData::GenericSP CreateScriptCommandObject(const char *class_name)
virtual bool ScriptedThreadPlanGetStopDescription(StructuredData::ObjectSP implementor_sp, lldb_private::Stream *stream, bool &script_error)
virtual size_t CalculateNumChildren(const StructuredData::ObjectSP &implementor, uint32_t max)
virtual bool GenerateTypeScriptFunction(const char *oneliner, std::string &output, const void *name_token=nullptr)
virtual bool RunScriptFormatKeyword(const char *impl_function, Target *target, std::string &output, Status &error)
virtual bool GenerateTypeScriptFunction(StringList &input, std::string &output, const void *name_token=nullptr)
virtual lldb::ScriptedProcessInterfaceUP CreateScriptedProcessInterface()
virtual Status ExportFunctionDefinitionToInterpreter(StringList &function_def)
virtual int GetIndexOfChildWithName(const StructuredData::ObjectSP &implementor, const char *child_name)
~ScriptInterpreter() override=default
virtual StructuredData::ObjectSP CreateSyntheticScriptedProvider(const char *class_name, lldb::ValueObjectSP valobj)
virtual StructuredData::DictionarySP OSPlugin_CreateThread(StructuredData::ObjectSP os_plugin_object_sp, lldb::tid_t tid, lldb::addr_t context)
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 llvm::Expected< unsigned > GetMaxPositionalArgumentsForCallable(const llvm::StringRef &callable_name)
virtual bool ExecuteOneLineWithReturn(llvm::StringRef in_string, ScriptReturnType return_type, void *ret_value, const ExecuteScriptOptions &options=ExecuteScriptOptions())
virtual bool ScriptedBreakpointResolverSearchCallback(StructuredData::GenericSP implementor_sp, SymbolContext *sym_ctx)
virtual bool GenerateTypeSynthClass(StringList &input, std::string &output, const void *name_token=nullptr)
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 void ExecuteInterpreterLoop()=0
virtual StructuredData::GenericSP CreateFrameRecognizer(const char *class_name)
virtual bool GenerateScriptAliasFunction(StringList &input, std::string &output)
virtual StructuredData::ObjectSP CreateScriptedThreadPlan(const char *class_name, const StructuredDataImpl &args_data, std::string &error_str, lldb::ThreadPlanSP thread_plan_sp)
virtual bool MightHaveChildrenSynthProviderInstance(const StructuredData::ObjectSP &implementor)
virtual StructuredData::StringSP OSPlugin_RegisterContextData(StructuredData::ObjectSP os_plugin_object_sp, lldb::tid_t thread_id)
virtual bool GenerateWatchpointCommandCallbackData(StringList &input, std::string &output, bool is_callback)
virtual StructuredData::DictionarySP GetDynamicSettings(StructuredData::ObjectSP plugin_module_sp, Target *target, const char *setting_name, lldb_private::Status &error)
virtual bool ScriptedStopHookHandleStop(StructuredData::GenericSP implementor_sp, ExecutionContext &exc_ctx, lldb::StreamSP stream_sp)
virtual Status GenerateFunction(const char *signature, const StringList &input, bool is_callback)
virtual lldb::ValueObjectSP GetChildAtIndex(const StructuredData::ObjectSP &implementor, uint32_t idx)
virtual void SetWatchpointCommandCallback(WatchpointOptions *wp_options, const char *user_input, bool is_callback)
Set a one-liner as the callback for the watchpoint.
ScriptedPlatformInterface & GetScriptedPlatformInterface()
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.
lldb::ProcessLaunchInfoSP GetOpaqueTypeFromSBLaunchInfo(const lldb::SBLaunchInfo &launch_info) const
lldb::ScriptedPlatformInterfaceUP m_scripted_platform_interface_up
virtual lldb::ValueObjectSP GetSyntheticValue(const StructuredData::ObjectSP &implementor)
virtual bool ExecuteOneLine(llvm::StringRef command, CommandReturnObject *result, const ExecuteScriptOptions &options=ExecuteScriptOptions())=0
virtual bool RunScriptFormatKeyword(const char *impl_function, StackFrame *frame, std::string &output, Status &error)
virtual Status GenerateBreakpointCommandCallbackData(StringList &input, std::string &output, bool has_extra_args, bool is_callback)
static std::string LanguageToString(lldb::ScriptLanguage language)
virtual lldb::SearchDepth ScriptedBreakpointResolverSearchDepth(StructuredData::GenericSP implementor_sp)
virtual bool RunScriptFormatKeyword(const char *impl_function, ValueObject *value, std::string &output, Status &error)
Status GetStatusFromSBError(const lldb::SBError &error) const
std::optional< MemoryRegionInfo > GetOpaqueTypeFromSBMemoryRegionInfo(const lldb::SBMemoryRegionInfo &mem_region) const
virtual std::unique_ptr< ScriptInterpreterLocker > AcquireInterpreterLock()
virtual bool GetDocumentationForItem(const char *item, std::string &dest)
virtual StructuredData::DictionarySP GetInterpreterInfo()
virtual bool ScriptedThreadPlanExplainsStop(StructuredData::ObjectSP implementor_sp, Event *event, bool &script_error)
virtual bool UpdateSynthProviderInstance(const StructuredData::ObjectSP &implementor)
virtual StructuredData::ObjectSP LoadPluginModule(const FileSpec &file_spec, lldb_private::Status &error)
Status SetBreakpointCommandCallbackFunction(std::vector< std::reference_wrapper< BreakpointOptions > > &bp_options_vec, const char *function_name, StructuredData::ObjectSP extra_args_sp)
virtual bool GenerateTypeSynthClass(const char *oneliner, std::string &output, const void *name_token=nullptr)
virtual StructuredData::ObjectSP CreateStructuredDataFromScriptObject(ScriptObject obj)
virtual bool GetScriptedSummary(const char *function_name, lldb::ValueObjectSP valobj, StructuredData::ObjectSP &callee_wrapper_sp, const TypeSummaryOptions &options, std::string &retval)
virtual Status SetBreakpointCommandCallback(BreakpointOptions &bp_options, std::unique_ptr< BreakpointOptions::CommandData > &data_up)
This one is for deserialization:
virtual lldb::StateType ScriptedThreadPlanGetRunState(StructuredData::ObjectSP implementor_sp, bool &script_error)
virtual StructuredData::GenericSP OSPlugin_CreatePluginObject(const char *class_name, lldb::ProcessSP process_sp)
lldb::BreakpointSP GetOpaqueTypeFromSBBreakpoint(const lldb::SBBreakpoint &breakpoint) const
virtual bool GetLongHelpForCommandObject(StructuredData::GenericSP cmd_obj_sp, std::string &dest)
virtual bool ScriptedThreadPlanShouldStop(StructuredData::ObjectSP implementor_sp, Event *event, bool &script_error)
virtual bool RunScriptFormatKeyword(const char *impl_function, Thread *thread, std::string &output, Status &error)
virtual bool CheckObjectExists(const char *name)
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 FormatterCallbackFunction(const char *function_name, lldb::TypeImplSP type_impl_sp)
virtual ConstString GetSyntheticTypeName(const StructuredData::ObjectSP &implementor)
lldb::ScriptLanguage m_script_lang
lldb::ScriptLanguage GetLanguage()
virtual uint32_t GetFlagsForCommandObject(StructuredData::GenericSP cmd_obj_sp)
@ eScriptReturnTypeOpaqueObject
@ eScriptReturnTypeDouble
@ eScriptReturnTypeLongLongUnsigned
@ eScriptReturnTypeIntUnsigned
@ eScriptReturnTypeLongIntUnsigned
@ eScriptReturnTypeShortInt
@ eScriptReturnTypeCharPtr
@ eScriptReturnTypeLongInt
@ eScriptReturnTypeShortIntUnsigned
@ eScriptReturnTypeCharStrOrNone
@ eScriptReturnTypeLongLong
virtual bool GetShortHelpForCommandObject(StructuredData::GenericSP cmd_obj_sp, std::string &dest)
virtual StructuredData::GenericSP CreateScriptedStopHook(lldb::TargetSP target_sp, const char *class_name, const StructuredDataImpl &args_data, Status &error)
virtual bool ScriptedThreadPlanIsStale(StructuredData::ObjectSP implementor_sp, bool &script_error)
virtual bool IsReservedWord(const char *word)
virtual StructuredData::GenericSP CreateScriptedBreakpointResolver(const char *class_name, const StructuredDataImpl &args_data, lldb::BreakpointSP &bkpt_sp)
lldb::DataExtractorSP GetDataExtractorFromSBData(const lldb::SBData &data) const
virtual bool RunScriptFormatKeyword(const char *impl_function, Process *process, std::string &output, Status &error)
virtual Status SetBreakpointCommandCallback(BreakpointOptions &bp_options, const char *callback_text, bool is_callback)
virtual void CollectDataForWatchpointCommandCallback(WatchpointOptions *wp_options, CommandReturnObject &result)
virtual StructuredData::DictionarySP OSPlugin_RegisterInfo(StructuredData::ObjectSP os_plugin_object_sp)
virtual StructuredData::ArraySP OSPlugin_ThreadsInfo(StructuredData::ObjectSP os_plugin_object_sp)
This base class provides an interface to stack frames.
A stream class that can stream formatted output to a file.
std::shared_ptr< Generic > GenericSP
std::shared_ptr< Dictionary > DictionarySP
std::shared_ptr< Object > ObjectSP
std::shared_ptr< String > StringSP
std::shared_ptr< Array > ArraySP
Defines a symbol context baton that can be handed other debug core functions.
"lldb/Core/ThreadedCommunication.h" Variation of Communication that supports threaded reads.
"lldb/Breakpoint/WatchpointOptions.h" Class that manages the options on a watchpoint.
A class that represents a running process on the host machine.
ScriptedCommandSynchronicity
std::unique_ptr< lldb_private::ScriptedPlatformInterface > ScriptedPlatformInterfaceUP
ScriptLanguage
Script interpreter types.
std::shared_ptr< lldb_private::ThreadPlan > ThreadPlanSP
std::shared_ptr< lldb_private::StackFrame > StackFrameSP
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
std::shared_ptr< lldb_private::ProcessAttachInfo > ProcessAttachInfoSP
StateType
Process and Thread States.
@ eStateStepping
Process or thread is in the process of stepping and can not be examined.
std::shared_ptr< lldb_private::Stream > StreamSP
std::shared_ptr< lldb_private::Breakpoint > BreakpointSP
std::shared_ptr< lldb_private::Process > ProcessSP
std::shared_ptr< lldb_private::ValueObjectList > ValueObjectListSP
std::shared_ptr< lldb_private::StreamFile > StreamFileSP
std::shared_ptr< lldb_private::TypeImpl > TypeImplSP
std::shared_ptr< lldb_private::Target > TargetSP
std::shared_ptr< lldb_private::File > FileSP
std::shared_ptr< lldb_private::DataExtractor > DataExtractorSP
std::unique_ptr< lldb_private::ScriptedProcessInterface > ScriptedProcessInterfaceUP
std::shared_ptr< lldb_private::ProcessLaunchInfo > ProcessLaunchInfoSP