@@ -7,15 +7,21 @@ namespace System.Diagnostics
7
7
{
8
8
public class EnhancedStackFrame : StackFrame
9
9
{
10
- private string _fileName ;
11
- private int _lineNumber ;
12
- private int _colNumber ;
10
+ private readonly string ? _fileName ;
11
+ private readonly int _lineNumber ;
12
+ private readonly int _colNumber ;
13
13
14
14
public StackFrame StackFrame { get ; }
15
15
16
+ public bool IsRecursive
17
+ {
18
+ get => MethodInfo . RecurseCount > 0 ;
19
+ internal set => MethodInfo . RecurseCount ++ ;
20
+ }
21
+
16
22
public ResolvedMethod MethodInfo { get ; }
17
23
18
- internal EnhancedStackFrame ( StackFrame stackFrame , ResolvedMethod methodInfo , string fileName , int lineNumber , int colNumber )
24
+ internal EnhancedStackFrame ( StackFrame stackFrame , ResolvedMethod methodInfo , string ? fileName , int lineNumber , int colNumber )
19
25
: base ( fileName , lineNumber , colNumber )
20
26
{
21
27
StackFrame = stackFrame ;
@@ -26,6 +32,14 @@ internal EnhancedStackFrame(StackFrame stackFrame, ResolvedMethod methodInfo, st
26
32
_colNumber = colNumber ;
27
33
}
28
34
35
+ internal bool IsEquivalent ( ResolvedMethod methodInfo , string ? fileName , int lineNumber , int colNumber )
36
+ {
37
+ return _lineNumber == lineNumber &&
38
+ _colNumber == colNumber &&
39
+ _fileName == fileName &&
40
+ MethodInfo . IsSequentialEquivalent ( methodInfo ) ;
41
+ }
42
+
29
43
/// <summary>
30
44
/// Gets the column number in the file that contains the code that is executing.
31
45
/// This information is typically extracted from the debugging symbols for the executable.
@@ -45,7 +59,7 @@ internal EnhancedStackFrame(StackFrame stackFrame, ResolvedMethod methodInfo, st
45
59
/// This information is typically extracted from the debugging symbols for the executable.
46
60
/// </summary>
47
61
/// <returns>The file name, or null if the file name cannot be determined.</returns>
48
- public override string GetFileName ( ) => _fileName ;
62
+ public override string ? GetFileName ( ) => _fileName ;
49
63
50
64
/// <summary>
51
65
/// Gets the offset from the start of the Microsoft intermediate language (MSIL)
@@ -60,7 +74,7 @@ internal EnhancedStackFrame(StackFrame stackFrame, ResolvedMethod methodInfo, st
60
74
/// Gets the method in which the frame is executing.
61
75
/// </summary>
62
76
/// <returns>The method in which the frame is executing.</returns>
63
- public override MethodBase GetMethod ( ) => StackFrame . GetMethod ( ) ;
77
+ public override MethodBase ? GetMethod ( ) => StackFrame . GetMethod ( ) ;
64
78
65
79
/// <summary>
66
80
/// Gets the offset from the start of the native just-in-time (JIT)-compiled code
0 commit comments