aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Interpreter/ScriptInterpreter.cpp
diff options
context:
space:
mode:
authorMed Ismail Bennani <ismail@bennani.ma>2023-10-30 16:52:17 -0700
committerGitHub <noreply@github.com>2023-10-30 16:52:17 -0700
commit4b3cd379cce3f455bf3c8677ca7a5be6e708a4ce (patch)
tree4d1348946d3a079d0c929de12280dd804854aad7 /lldb/source/Interpreter/ScriptInterpreter.cpp
parentc2f642d90d33a4e6c987b52e22eca4221c86c601 (diff)
downloadllvm-4b3cd379cce3f455bf3c8677ca7a5be6e708a4ce.zip
llvm-4b3cd379cce3f455bf3c8677ca7a5be6e708a4ce.tar.gz
llvm-4b3cd379cce3f455bf3c8677ca7a5be6e708a4ce.tar.bz2
[lldb] Make use of Scripted{Python,}Interface for ScriptedThreadPlan (#70392)
This patch makes ScriptedThreadPlan conforming to the ScriptedInterface & ScriptedPythonInterface facilities by introducing 2 ScriptedThreadPlanInterface & ScriptedThreadPlanPythonInterface classes. This allows us to get rid of every ScriptedThreadPlan-specific SWIG method and re-use the same affordances as other scripting offordances, like Scripted{Process,Thread,Platform} & OperatingSystem. To do so, this adds new transformer methods for `ThreadPlan`, `Stream` & `Event`, to allow the bijection between C++ objects and their python counterparts. Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
Diffstat (limited to 'lldb/source/Interpreter/ScriptInterpreter.cpp')
-rw-r--r--lldb/source/Interpreter/ScriptInterpreter.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/lldb/source/Interpreter/ScriptInterpreter.cpp b/lldb/source/Interpreter/ScriptInterpreter.cpp
index fb3fa74..aee2ec9 100644
--- a/lldb/source/Interpreter/ScriptInterpreter.cpp
+++ b/lldb/source/Interpreter/ScriptInterpreter.cpp
@@ -104,6 +104,19 @@ ScriptInterpreter::GetStatusFromSBError(const lldb::SBError &error) const {
return Status();
}
+Event *
+ScriptInterpreter::GetOpaqueTypeFromSBEvent(const lldb::SBEvent &event) const {
+ return event.m_opaque_ptr;
+}
+
+Stream *ScriptInterpreter::GetOpaqueTypeFromSBStream(
+ const lldb::SBStream &stream) const {
+ if (stream.m_opaque_up)
+ return const_cast<lldb::SBStream &>(stream).m_opaque_up.get();
+
+ return nullptr;
+}
+
std::optional<MemoryRegionInfo>
ScriptInterpreter::GetOpaqueTypeFromSBMemoryRegionInfo(
const lldb::SBMemoryRegionInfo &mem_region) const {