hide inlined frames
This commit is contained in:
parent
d2e58a8b54
commit
84d3257a8f
@ -615,6 +615,18 @@ namespace System.Diagnostics
|
||||
{
|
||||
Debug.Assert(method != null);
|
||||
|
||||
// Since .NET 5:
|
||||
// https://github.com/dotnet/runtime/blob/7c18d4d6488dab82124d475d1199def01d1d252c/src/libraries/System.Private.CoreLib/src/System/Diagnostics/StackTrace.cs#L348-L361
|
||||
if ((method.MethodImplementationFlags & MethodImplAttributes.AggressiveInlining) != 0)
|
||||
{
|
||||
// Aggressive Inlines won't normally show in the StackTrace; however for Tier0 Jit and
|
||||
// cross-assembly AoT/R2R these inlines will be blocked until Tier1 Jit re-Jits
|
||||
// them when they will inline. We don't show them in the StackTrace to bring consistency
|
||||
// between this first-pass asm and fully optimized asm.
|
||||
return false;
|
||||
}
|
||||
|
||||
// Since .NET Core 2:
|
||||
if (StackTraceHiddenAttributeType != null)
|
||||
{
|
||||
// Don't show any methods marked with the StackTraceHiddenAttribute
|
||||
@ -632,6 +644,17 @@ namespace System.Diagnostics
|
||||
return true;
|
||||
}
|
||||
|
||||
// Since .NET Core 2:
|
||||
if (StackTraceHiddenAttributeType != null)
|
||||
{
|
||||
// Don't show any methods marked with the StackTraceHiddenAttribute
|
||||
// https://github.com/dotnet/coreclr/pull/14652
|
||||
if (IsStackTraceHidden(type))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (type == typeof(Task<>) && method.Name == "InnerInvoke")
|
||||
{
|
||||
return false;
|
||||
@ -662,23 +685,13 @@ namespace System.Diagnostics
|
||||
}
|
||||
}
|
||||
|
||||
if (StackTraceHiddenAttributeType != null)
|
||||
{
|
||||
// Don't show any types marked with the StackTraceHiddenAttribute
|
||||
// https://github.com/dotnet/coreclr/pull/14652
|
||||
if (IsStackTraceHidden(type))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Fallbacks for runtime pre-StackTraceHiddenAttribute
|
||||
if (type == typeof(ExceptionDispatchInfo) && method.Name == "Throw")
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (type == typeof(TaskAwaiter) ||
|
||||
|
||||
if (type == typeof(TaskAwaiter) ||
|
||||
type == typeof(TaskAwaiter<>) ||
|
||||
type == typeof(ValueTaskAwaiter) ||
|
||||
type == typeof(ValueTaskAwaiter<>) ||
|
||||
@ -700,7 +713,6 @@ namespace System.Diagnostics
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user