File tree 2 files changed +16
-3
lines changed
2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -364,6 +364,8 @@ struct PendingFinalization
364
364
{
365
365
public IntPtr PyObj ;
366
366
public BorrowedReference Ref => new ( PyObj ) ;
367
+ public ManagedType ? Managed => ManagedType . GetManagedObject ( Ref ) ;
368
+ public nint RefCount => Runtime . Refcount ( Ref ) ;
367
369
public int RuntimeRun ;
368
370
#if TRACE_ALLOC
369
371
public string StackTrace ;
Original file line number Diff line number Diff line change @@ -1051,9 +1051,20 @@ public PyList Dir()
1051
1051
return Runtime . GetManagedString ( strval . BorrowOrThrow ( ) ) ;
1052
1052
}
1053
1053
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
+ }
1057
1068
1058
1069
1059
1070
/// <summary>
You can’t perform that action at this time.
0 commit comments