9#ifndef LLDB_INTERPRETER_SCRIPTINTERPRETER_H
10#define LLDB_INTERPRETER_SCRIPTINTERPRETER_H
107 static llvm::Expected<std::unique_ptr<ScriptInterpreterIORedirect>>
125 std::unique_ptr<File> output);
170 llvm::SmallVector<llvm::StringRef>
path;
173 virtual llvm::Expected<FileSpec>
175 std::vector<ExtensionTemplateRequest> &extensions,
176 bool generate_non_abstract_methods,
177 std::string output_file);
196 const char *in_string,
221 const void *name_token =
nullptr) {
227 const void *name_token =
nullptr) {
232 std::string &output) {
237 const void *name_token =
nullptr) {
242 const void *name_token =
nullptr) {
264 std::vector<std::reference_wrapper<BreakpointOptions>> &options,
273 std::vector<std::reference_wrapper<BreakpointOptions>> &bp_options_vec,
274 const char *callback_text);
277 const char *callback_text,
285 std::unique_ptr<BreakpointOptions::CommandData> &data_up) {
290 std::vector<std::reference_wrapper<BreakpointOptions>> &bp_options_vec,
296 const char *function_name,
303 const char *user_input,
310 std::string &retval) {
336 Process *process, std::string &output,
388 virtual llvm::Expected<unsigned>
390 return llvm::createStringError(
391 llvm::inconvertibleErrorCode(),
"Unimplemented function");
398 virtual llvm::Expected<std::string>
400 return llvm::make_error<UnimplementedError>();
403 static llvm::StringLiteral
483 std::string conflicting_keyword)
static llvm::raw_ostream & error(Stream &strm)
"lldb/Breakpoint/BreakpointOptions.h" Class that manages the options on a breakpoint or breakpoint lo...
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
std::recursive_mutex Mutex
PluginInterface()=default
A plug-in interface definition class for debugging a process.
lldb::FileSP GetOutputFile() const
lldb::FileSP m_input_file_sp
ThreadedCommunication m_communication
lldb::FileSP GetErrorFile() const
~ScriptInterpreterIORedirect()
void Flush()
Flush our output and error file handles.
ScriptInterpreterIORedirect(std::unique_ptr< File > input, std::unique_ptr< File > output)
lldb::FileSP GetInputFile() const
static llvm::Expected< std::unique_ptr< ScriptInterpreterIORedirect > > Create(bool enable_io, Debugger &debugger, CommandReturnObject *result)
Create an IO redirect.
lldb::LockableStreamFileSP m_error_file_sp
LockableStreamFile::Mutex m_output_mutex
lldb::LockableStreamFileSP m_output_file_sp
ScriptInterpreterLocker()=default
const ScriptInterpreterLocker & operator=(const ScriptInterpreterLocker &)=delete
ScriptInterpreterLocker(const ScriptInterpreterLocker &)=delete
virtual ~ScriptInterpreterLocker()=default
Holds an lldb_private::Module name and a "sanitized" version of it for the purposes of loading a scri...
bool RequiredSanitization() const
Returns true if the original name has been sanitized (i.e., required changes).
llvm::StringRef GetSanitizedName() const
SanitizedScriptingModuleName(std::string name, std::string sanitized_name, std::string conflicting_keyword)
llvm::StringRef GetConflictingKeyword() const
std::string m_sanitized_name
std::string m_original_name
llvm::StringRef GetOriginalName() const
std::string m_conflicting_keyword
If the m_sanitized_name conflicts with a keyword for the ScriptInterpreter language associated with t...
bool IsKeyword() const
Returns true if this name is a keyword in the associated scripting language.
static lldb::ScriptLanguage StringToLanguage(const llvm::StringRef &string)
virtual lldb::ScriptedHookInterfaceSP CreateScriptedHookInterface()
virtual void CollectDataForBreakpointCommandCallback(std::vector< std::reference_wrapper< BreakpointOptions > > &options, CommandReturnObject &result)
const char * GetScriptInterpreterPtyName()
virtual Status ExecuteMultipleLines(const char *in_string, const ExecuteScriptOptions &options=ExecuteScriptOptions())
virtual lldb::ScriptedSyntheticChildrenInterfaceSP CreateScriptedSyntheticChildrenInterface()
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 lldb::ScriptedFrameInterfaceSP CreateScriptedFrameInterface()
virtual Status ExportFunctionDefinitionToInterpreter(StringList &function_def)
~ScriptInterpreter() override=default
virtual lldb::OperatingSystemInterfaceSP CreateOperatingSystemInterface()
virtual lldb::ScriptedCommandInterfaceSP CreateScriptedCommandInterface()
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 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 llvm::Expected< FileSpec > GenerateExtensionTemplate(const std::string &name, std::vector< ExtensionTemplateRequest > &extensions, bool generate_non_abstract_methods, std::string output_file)
virtual void ExecuteInterpreterLoop()=0
virtual lldb::ScriptedBreakpointInterfaceSP CreateScriptedBreakpointInterface()
virtual bool GenerateScriptAliasFunction(StringList &input, std::string &output)
static llvm::StringLiteral ExtensionToString(lldb::ScriptedExtension extension)
virtual llvm::Expected< std::string > ExtensionToImportPath(lldb::ScriptedExtension extension)
static lldb::ScriptedExtension StringToExtension(llvm::StringRef string)
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 lldb::ScriptedStringSummaryInterfaceSP CreateScriptedStringSummaryInterface()
virtual Status GenerateFunction(const char *signature, const StringList &input, bool is_callback)
virtual void SetWatchpointCommandCallback(WatchpointOptions *wp_options, const char *user_input, bool is_callback)
Set a one-liner as the callback for the watchpoint.
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 bool ExecuteOneLine(llvm::StringRef command, CommandReturnObject *result, const ExecuteScriptOptions &options=ExecuteScriptOptions())=0
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 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 bool RunScriptFormatKeyword(const char *impl_function, ValueObject *value, std::string &output, Status &error)
virtual std::unique_ptr< ScriptInterpreterLocker > AcquireInterpreterLock()
virtual bool GetDocumentationForItem(const char *item, std::string &dest)
virtual StructuredData::DictionarySP GetInterpreterInfo()
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:
const Debugger & GetDebugger() const
virtual lldb::ScriptedThreadPlanInterfaceSP CreateScriptedThreadPlanInterface()
virtual bool RunScriptFormatKeyword(const char *impl_function, Thread *thread, std::string &output, Status &error)
virtual bool CheckObjectExists(const char *name)
virtual bool FormatterCallbackFunction(const char *function_name, lldb::TypeImplSP type_impl_sp)
lldb::ScriptLanguage m_script_lang
lldb::ScriptLanguage GetLanguage()
@ eScriptReturnTypeOpaqueObject
@ eScriptReturnTypeDouble
@ eScriptReturnTypeLongLongUnsigned
@ eScriptReturnTypeIntUnsigned
@ eScriptReturnTypeLongIntUnsigned
@ eScriptReturnTypeShortInt
@ eScriptReturnTypeCharPtr
@ eScriptReturnTypeLongInt
@ eScriptReturnTypeShortIntUnsigned
@ eScriptReturnTypeCharStrOrNone
@ eScriptReturnTypeLongLong
virtual bool IsReservedWord(const char *word)
virtual lldb::ScriptedPlatformInterfaceUP GetScriptedPlatformInterface()
virtual bool RunScriptFormatKeyword(const char *impl_function, Process *process, std::string &output, Status &error)
virtual lldb::ScriptedThreadInterfaceSP CreateScriptedThreadInterface()
virtual Status SetBreakpointCommandCallback(BreakpointOptions &bp_options, const char *callback_text, bool is_callback)
virtual lldb::ScriptedFrameProviderInterfaceSP CreateScriptedFrameProviderInterface()
ScriptInterpreter(Debugger &debugger, lldb::ScriptLanguage script_lang)
virtual void CollectDataForWatchpointCommandCallback(WatchpointOptions *wp_options, CommandReturnObject &result)
virtual SanitizedScriptingModuleName GetSanitizedScriptingModuleName(llvm::StringRef name)
virtual lldb::ScriptedStackFrameRecognizerInterfaceSP CreateScriptedStackFrameRecognizerInterface()
Debugger & GetDebugger()
Get the debugger associated with this script interpreter.
This base class provides an interface to stack frames.
static Status FromErrorString(const char *str)
std::shared_ptr< Dictionary > DictionarySP
std::shared_ptr< Object > ObjectSP
"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.
ScriptedExtension
Scripting extension types.
std::shared_ptr< lldb_private::ScriptedSyntheticChildrenInterface > ScriptedSyntheticChildrenInterfaceSP
std::shared_ptr< lldb_private::ScriptedHookInterface > ScriptedHookInterfaceSP
std::shared_ptr< lldb_private::ScriptedStringSummaryInterface > ScriptedStringSummaryInterfaceSP
std::shared_ptr< lldb_private::ScriptedThreadPlanInterface > ScriptedThreadPlanInterfaceSP
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
std::shared_ptr< lldb_private::OperatingSystemInterface > OperatingSystemInterfaceSP
std::shared_ptr< lldb_private::ScriptedBreakpointInterface > ScriptedBreakpointInterfaceSP
std::shared_ptr< lldb_private::ScriptedThreadInterface > ScriptedThreadInterfaceSP
std::shared_ptr< lldb_private::ScriptedFrameProviderInterface > ScriptedFrameProviderInterfaceSP
std::shared_ptr< lldb_private::ScriptedCommandInterface > ScriptedCommandInterfaceSP
std::shared_ptr< lldb_private::LockableStreamFile > LockableStreamFileSP
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::ScriptedStackFrameRecognizerInterface > ScriptedStackFrameRecognizerInterfaceSP
std::unique_ptr< lldb_private::ScriptedProcessInterface > ScriptedProcessInterfaceUP
std::shared_ptr< lldb_private::ScriptedFrameInterface > ScriptedFrameInterfaceSP
Describes one extension to emit into the generated template file.
llvm::StringRef full_name
llvm::SmallVector< llvm::StringRef > path