diff options
author | Med Ismail Bennani <ismail@bennani.ma> | 2024-05-23 01:25:48 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-23 01:25:48 -0700 |
commit | 4cc6d0f4dfb26deb9863901c70258d6d7f0c8ba4 (patch) | |
tree | 9ef09fcb7d61fc5ac3ff3574c3c46e6786806fed /lldb/source/Interpreter/ScriptInterpreter.cpp | |
parent | 335e00faaf74f3f7463b32a415d39af0973f521f (diff) | |
download | llvm-4cc6d0f4dfb26deb9863901c70258d6d7f0c8ba4.zip llvm-4cc6d0f4dfb26deb9863901c70258d6d7f0c8ba4.tar.gz llvm-4cc6d0f4dfb26deb9863901c70258d6d7f0c8ba4.tar.bz2 |
[lldb] Make use of Scripted{Python,}Interface for ScriptedThreadPlan (Reland #70392) (#93149)
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.
This just re-lands #70392 after fixing test failures.
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 { |