[Lldb-commits] [lldb] [lldb] Make use of Scripted{Python, }Interface for ScriptedThreadPlan (PR #70392)

Med Ismail Bennani via lldb-commits lldb-commits at lists.llvm.org
Fri Oct 27 12:36:57 PDT 2023


================
@@ -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.release();
----------------
medismailben wrote:

`lldb::SBStream` have different semantics than other classes, as it uses a unique_ptr to point to its opaque type and  also `lldb_private::Stream` is an abstract type so the only way to get the underlying object is to do this. Let me know if you can think of a better way of doing it.

https://github.com/llvm/llvm-project/pull/70392


More information about the lldb-commits mailing list