12#include "lldb/Host/Config.h"
15#include "llvm/Support/ErrorExtras.h"
32 return LLDB_ENABLE_PYTHON;
34 return LLDB_ENABLE_LUA;
45 error = llvm::createStringError(
"its plugin was not loaded");
47 return llvm::createStringErrorV(
"{0} scripting is unavailable: {1}",
49 llvm::toString(std::move(
error)));
50 return llvm::Error::success();
54 return llvm::createStringError(
55 "Embedded script interpreter unavailable. LLDB was built without "
56 "scripting language support.");
69 "error: %s\n", llvm::toString(std::move(
error)).c_str());
88 module_sp, extra_search_dir,
89 loaded_into_target_sp);
93 std::vector<std::reference_wrapper<BreakpointOptions>> &options,
96 result.
AppendError(llvm::toString(std::move(unavailable)));
104 result.
AppendError(llvm::toString(std::move(unavailable)));
116 bp_options, callback_text, is_callback);
125 bp_options, function_name, extra_args_sp);
149 return std::make_shared<ScriptInterpreterNone>(debugger, requested_language);
153 return "Null script interpreter";
static llvm::raw_ostream & error(Stream &strm)
#define LLDB_PLUGIN_DEFINE(PluginName)
static llvm::Error CreateNoScriptingError()
static bool IsBuiltWith(lldb::ScriptLanguage language)
"lldb/Breakpoint/BreakpointOptions.h" Class that manages the options on a breakpoint or breakpoint lo...
void AppendError(llvm::StringRef in_string)
A class to manage flag bits.
static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description, ABICreateInstance create_callback)
static llvm::Error GetScriptInterpreterError(lldb::ScriptLanguage script_lang)
Returns the error recorded for script_lang, or success.
static bool UnregisterPlugin(ABICreateInstance create_callback)
Stands in for a script language without an interpreter, reporting why it is unavailable.
lldb::ScriptLanguage m_requested_language
llvm::Error SetBreakpointCommandCallback(BreakpointOptions &bp_options, const char *callback_text, bool is_callback) override
static lldb::ScriptInterpreterSP CreateInstance(Debugger &debugger, lldb::ScriptLanguage requested_language)
llvm::Error GetUnavailableError() const
Returns the error recorded for the requested language, or success.
bool ExecuteOneLine(llvm::StringRef command, CommandReturnObject *result, const ExecuteScriptOptions &options=ExecuteScriptOptions()) override
static llvm::StringRef GetPluginNameStatic()
void CollectDataForWatchpointCommandCallback(WatchpointOptions *wp_options, CommandReturnObject &result) override
llvm::Error SetBreakpointCommandCallbackFunction(BreakpointOptions &bp_options, const char *function_name, StructuredData::ObjectSP extra_args_sp) override
Set a script function as the callback for the breakpoint.
ScriptInterpreterNone(Debugger &debugger, lldb::ScriptLanguage requested_language)
static llvm::StringRef GetPluginDescriptionStatic()
void CollectDataForBreakpointCommandCallback(std::vector< std::reference_wrapper< BreakpointOptions > > &options, CommandReturnObject &result) override
llvm::Error SetWatchpointCommandCallback(WatchpointOptions *wp_options, const char *user_input, bool is_callback) override
Set a one-liner as the callback for the watchpoint.
~ScriptInterpreterNone() override
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={}) override
llvm::Error ExecuteInterpreterLoop() override
virtual void CollectDataForBreakpointCommandCallback(std::vector< std::reference_wrapper< BreakpointOptions > > &options, CommandReturnObject &result)
virtual llvm::Error SetWatchpointCommandCallback(WatchpointOptions *wp_options, const char *user_input, bool is_callback)
Set a one-liner as the callback for the watchpoint.
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={})
static std::string LanguageToString(lldb::ScriptLanguage language)
llvm::Error SetBreakpointCommandCallbackFunction(std::vector< std::reference_wrapper< BreakpointOptions > > &bp_options_vec, const char *function_name, StructuredData::ObjectSP extra_args_sp)
llvm::Error SetBreakpointCommandCallback(std::vector< std::reference_wrapper< BreakpointOptions > > &bp_options_vec, const char *callback_text)
Set the specified text as the callback for the breakpoint.
ScriptInterpreter(Debugger &debugger, lldb::ScriptLanguage script_lang)
virtual void CollectDataForWatchpointCommandCallback(WatchpointOptions *wp_options, CommandReturnObject &result)
static Status FromError(llvm::Error error)
Avoid using this in new code. Migrate APIs to llvm::Expected instead.
std::shared_ptr< Object > ObjectSP
"lldb/Breakpoint/WatchpointOptions.h" Class that manages the options on a watchpoint.
A class that represents a running process on the host machine.
ScriptLanguage
Script interpreter types.
std::shared_ptr< lldb_private::ScriptInterpreter > ScriptInterpreterSP
std::shared_ptr< lldb_private::Target > TargetSP