aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/Interfaces')
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedFramePythonInterface.cpp28
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedFramePythonInterface.h6
2 files changed, 34 insertions, 0 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedFramePythonInterface.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedFramePythonInterface.cpp
index 20ca7a2c0135..9cc7b04fc9db 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedFramePythonInterface.cpp
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedFramePythonInterface.cpp
@@ -154,4 +154,32 @@ std::optional<std::string> ScriptedFramePythonInterface::GetRegisterContext() {
return obj->GetAsString()->GetValue().str();
}
+lldb::ValueObjectListSP ScriptedFramePythonInterface::GetVariables() {
+ Status error;
+ auto vals = Dispatch<lldb::ValueObjectListSP>("get_variables", error);
+
+ if (error.Fail()) {
+ return ErrorWithMessage<lldb::ValueObjectListSP>(LLVM_PRETTY_FUNCTION,
+ error.AsCString(), error);
+ }
+
+ return vals;
+}
+
+lldb::ValueObjectSP
+ScriptedFramePythonInterface::GetValueObjectForVariableExpression(
+ llvm::StringRef expr, uint32_t options, Status &status) {
+ Status dispatch_error;
+ auto val = Dispatch<lldb::ValueObjectSP>("get_value_for_variable_expression",
+ dispatch_error, expr.data(), options,
+ status);
+
+ if (dispatch_error.Fail()) {
+ return ErrorWithMessage<lldb::ValueObjectSP>(
+ LLVM_PRETTY_FUNCTION, dispatch_error.AsCString(), dispatch_error);
+ }
+
+ return val;
+}
+
#endif
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedFramePythonInterface.h b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedFramePythonInterface.h
index 3aff237ae65d..d8ac093106bb 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedFramePythonInterface.h
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedFramePythonInterface.h
@@ -52,6 +52,12 @@ public:
StructuredData::DictionarySP GetRegisterInfo() override;
std::optional<std::string> GetRegisterContext() override;
+
+ lldb::ValueObjectListSP GetVariables() override;
+
+ lldb::ValueObjectSP
+ GetValueObjectForVariableExpression(llvm::StringRef expr, uint32_t options,
+ Status &status) override;
};
} // namespace lldb_private