diff options
author | Med Ismail Bennani <ismail@bennani.ma> | 2024-01-29 02:21:14 -0800 |
---|---|---|
committer | Med Ismail Bennani <ismail@bennani.ma> | 2024-01-29 03:17:33 -0800 |
commit | 888501bc631c4f6d373b4081ff6c504a1ce4a682 (patch) | |
tree | 6f95d3b7480b6b2b2d2a8eaff812b944ae313068 /lldb/source/Interpreter/ScriptInterpreter.cpp | |
parent | 5f4ee5a2dfa97fe32ee62d1d67aa1413d5a059e6 (diff) | |
download | llvm-888501bc631c4f6d373b4081ff6c504a1ce4a682.zip llvm-888501bc631c4f6d373b4081ff6c504a1ce4a682.tar.gz llvm-888501bc631c4f6d373b4081ff6c504a1ce4a682.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.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lldb/source/Interpreter/ScriptInterpreter.cpp b/lldb/source/Interpreter/ScriptInterpreter.cpp index 8dd499c..75b2a39 100644 --- a/lldb/source/Interpreter/ScriptInterpreter.cpp +++ b/lldb/source/Interpreter/ScriptInterpreter.cpp @@ -101,6 +101,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 { |