Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 82d6c33

Browse files
committed
sprinkled a few DebuggerHidden to make debugging easier
1 parent 74d87c5 commit 82d6c33

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

src/runtime/NewReference.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
namespace Python.Runtime
22
{
33
using System;
4+
using System.Diagnostics;
45
using System.Diagnostics.Contracts;
56
using System.Runtime.CompilerServices;
67

@@ -83,6 +84,7 @@ public StolenReference Steal()
8384
}
8485

8586
[MethodImpl(MethodImplOptions.AggressiveInlining)]
87+
[DebuggerHidden]
8688
public StolenReference StealOrThrow()
8789
{
8890
if (this.IsNull()) throw PythonException.ThrowLastAsClrException();
@@ -143,6 +145,7 @@ public static BorrowedReference BorrowNullable(this in NewReference reference)
143145
public static BorrowedReference Borrow(this in NewReference reference)
144146
=> reference.IsNull() ? throw new NullReferenceException() : reference.BorrowNullable();
145147
[Pure]
148+
[DebuggerHidden]
146149
public static BorrowedReference BorrowOrThrow(this in NewReference reference)
147150
=> reference.IsNull() ? throw PythonException.ThrowLastAsClrException() : reference.BorrowNullable();
148151

src/runtime/pythonexception.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public PythonException(PyType type, PyObject? value, PyObject? traceback)
3636
/// It is recommended to call this as <code>throw ThrowLastAsClrException()</code>
3737
/// to assist control flow checks.
3838
/// </summary>
39+
[DebuggerHidden]
3940
internal static Exception ThrowLastAsClrException()
4041
{
4142
// prevent potential interop errors in this method
@@ -416,6 +417,7 @@ internal static bool CurrentMatches(BorrowedReference ob)
416417
return Runtime.PyErr_ExceptionMatches(ob) != 0;
417418
}
418419

420+
[DebuggerHidden]
419421
internal static void ThrowIfIsNull(in NewReference ob)
420422
{
421423
if (ob.BorrowNullable() == null)
@@ -426,6 +428,7 @@ internal static void ThrowIfIsNull(in NewReference ob)
426428
internal static BorrowedReference ThrowIfIsNull(BorrowedReference ob)
427429
=> Exceptions.ErrorCheck(ob);
428430

431+
[DebuggerHidden]
429432
internal static void ThrowIfIsNotZero(int value)
430433
{
431434
if (value != 0)

0 commit comments

Comments
 (0)