diff options
author | Med Ismail Bennani <ismail@bennani.ma> | 2024-06-27 01:45:30 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-27 01:45:30 -0700 |
commit | 9a9ec228cdcf75d01be82be5be13e1542f0fc75d (patch) | |
tree | 166900d006c3dd1697450c533aa7a9ee9099e0e8 /lldb/source/Interpreter/ScriptInterpreter.cpp | |
parent | bf536cc7db1b1e683af34f363f62fa2b655262cf (diff) | |
download | llvm-9a9ec228cdcf75d01be82be5be13e1542f0fc75d.zip llvm-9a9ec228cdcf75d01be82be5be13e1542f0fc75d.tar.gz llvm-9a9ec228cdcf75d01be82be5be13e1542f0fc75d.tar.bz2 |
[lldb] Make use of Scripted{Python,}Interface for ScriptedThreadPlan (#70392) (#96868)
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 { |