File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed
Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -364,6 +364,8 @@ struct PendingFinalization
364364 {
365365 public IntPtr PyObj ;
366366 public BorrowedReference Ref => new ( PyObj ) ;
367+ public ManagedType ? Managed => ManagedType . GetManagedObject ( Ref ) ;
368+ public nint RefCount => Runtime . Refcount ( Ref ) ;
367369 public int RuntimeRun ;
368370#if TRACE_ALLOC
369371 public string StackTrace ;
Original file line number Diff line number Diff line change @@ -1051,9 +1051,20 @@ public PyList Dir()
10511051 return Runtime . GetManagedString ( strval . BorrowOrThrow ( ) ) ;
10521052 }
10531053
1054- string ? DebuggerDisplay => DebugUtil . HaveInterpreterLock ( )
1055- ? this . ToString ( )
1056- : $ "pyobj at 0x{ this . rawPtr : X} (get Py.GIL to see more info)";
1054+ ManagedType ? InternalManagedObject => ManagedType . GetManagedObject ( this . Reference ) ;
1055+
1056+ string ? DebuggerDisplay
1057+ {
1058+ get
1059+ {
1060+ if ( DebugUtil . HaveInterpreterLock ( ) )
1061+ return this . ToString ( ) ;
1062+ var obj = this . InternalManagedObject ;
1063+ return obj is { }
1064+ ? obj . ToString ( )
1065+ : $ "pyobj at 0x{ this . rawPtr : X} (get Py.GIL to see more info)";
1066+ }
1067+ }
10571068
10581069
10591070 /// <summary>
You can’t perform that action at this time.
0 commit comments