================
@@ -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
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to