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

Alex Langford via lldb-commits lldb-commits at lists.llvm.org
Fri Oct 27 11:45:04 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();
----------------
bulbazord wrote:

This feels a little sketchy to me... `GetOpaqueTypeFromSBStream` is taking ownership of the underlying pointer and returning it to the caller. The `SBStream` that gets passed in is no longer valid. Is this intentional? That would mean this function -- and only this function -- has different semantics from the other `GetOpaqueTypeFromSBClass` functions.

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


More information about the lldb-commits mailing list