12#include "lldb/Host/Config.h"
32llvm::Expected<StructuredData::GenericSP>
37 std::make_shared<ExecutionContextRef>(exe_ctx);
40 scripted_metadata, script_obj, exe_ctx_ref_sp, args_sp);
96 return obj->GetStringValue().str();
99std::optional<std::string>
108 return obj->GetStringValue().str();
119 return obj->GetBooleanValue();
130 return obj->GetBooleanValue();
141 return obj->GetBooleanValue();
164 return obj->GetAsString()->GetValue().str();
179std::optional<lldb::ValueType>
184 "get_value_type_for_variable",
error, std::move(value));
188 LLVM_PRETTY_FUNCTION,
error.AsCString(),
error);
196 llvm::StringRef expr, uint32_t options,
Status &status) {
199 dispatch_error, expr.data(), options,
202 if (dispatch_error.
Fail()) {
204 LLVM_PRETTY_FUNCTION, dispatch_error.
AsCString(), dispatch_error);
210llvm::Expected<ScriptedMetadata>
217 "get_plan_spec_for_step_type",
error, step_type);
223 llvm::StringRef err_str(
error.AsCString());
224 if (err_str.contains(
225 "object has no attribute 'get_plan_spec_for_step_type'"))
226 return no_plan_return;
228 return llvm::createStringError(
229 "error dispatching get_plan_spec_for_step_type: %s",
237 return llvm::createStringError(
238 "return from get_plan_spec_for_step_type not a valid object: %s",
243 return llvm::createStringError(
"Required 'class_name' field not provided.");
245 std::string class_string = obj->GetStringValue().str();
250 if (!class_string.empty()) {
251 const char *class_str = class_string.c_str();
253 return llvm::createStringError(
254 "class_name specified a class: '%s' that does not exist.", class_str);
260 if (dict_sp->GetValueForKeyAsDictionary(
"extra_args", extra_args_ptr))
261 extra_args_sp = std::static_pointer_cast<StructuredData::Dictionary>(
262 extra_args_ptr->shared_from_this());
267 return plan_metadata;
273 "Provide frame state for scripted threads and frame providers.",
static llvm::raw_ostream & error(Stream &strm)
ScriptInterpreterPythonImpl::Locker Locker
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description, ABICreateInstance create_callback)
static bool UnregisterPlugin(ABICreateInstance create_callback)
std::optional< std::string > GetRegisterContext() override
lldb::user_id_t GetID() override
static llvm::StringRef GetPluginNameStatic()
std::optional< lldb::ValueType > GetValueTypeForVariable(lldb::ValueObjectSP value) override
Report which kind of variable valobj is presented as, for instance eValueTypeVariableLocal to have it...
llvm::Expected< ScriptedMetadata > GetThreadPlanMetadataForStepType(lldb::StepType step_type) override
lldb::addr_t GetCFA() override
lldb::addr_t GetPC() override
lldb::ValueObjectListSP GetVariables() override
std::optional< std::string > GetDisplayFunctionName() override
std::optional< SymbolContext > GetSymbolContext() override
StructuredData::DictionarySP GetRegisterInfo() override
bool IsInlined() override
lldb::ValueObjectSP GetValueObjectForVariableExpression(llvm::StringRef expr, uint32_t options, Status &status) override
std::optional< std::string > GetFunctionName() override
bool IsArtificial() override
llvm::Expected< StructuredData::GenericSP > CreatePluginObject(llvm::StringRef class_name, ExecutionContext &exe_ctx, StructuredData::DictionarySP args_sp, StructuredData::Generic *script_obj=nullptr) override
ScriptedFramePythonInterface(ScriptInterpreterPythonImpl &interpreter)
static Ret ErrorWithMessage(llvm::StringRef caller_name, llvm::StringRef user_msg, Status &error, LLDBLog log_category=LLDBLog::Process)
static bool CheckStructuredDataObject(llvm::StringRef caller, T obj, Status &error)
static bool CreateInstance(lldb::ScriptLanguage language, ScriptedInterfaceUsages usages)
ScriptInterpreterPythonImpl & m_interpreter
ScriptedPythonInterface(ScriptInterpreterPythonImpl &interpreter)
T Dispatch(llvm::StringRef method_name, Status &error, Args &&...args)
llvm::Expected< StructuredData::GenericSP > CreatePluginObject(const ScriptedMetadata &scripted_metadata, StructuredData::Generic *script_obj, Args... args)
bool Fail() const
Test for error condition.
const char * AsCString(const char *default_error_str="unknown error") const
Get the error string associated with the current error.
std::shared_ptr< Dictionary > DictionarySP
std::shared_ptr< Object > ObjectSP
#define LLDB_INVALID_ADDRESS
#define LLDB_INVALID_FRAME_ID
A class that represents a running process on the host machine.
@ eScriptedExtensionScriptedFrame
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
std::shared_ptr< lldb_private::ValueObjectList > ValueObjectListSP
std::shared_ptr< lldb_private::ExecutionContextRef > ExecutionContextRefSP