Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
Skip EDI boundary for async
Browse files Browse the repository at this point in the history
  • Loading branch information
benaadams committed Jan 14, 2018
1 parent decccc8 commit ded78a3
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/mscorlib/src/System/Diagnostics/Stacktrace.cs
Expand Up @@ -498,12 +498,16 @@ internal String ToString(TraceFormat traceFormat)

sb.AppendFormat(CultureInfo.InvariantCulture, " {0} ", word_At);

Type t = mb.DeclaringType;
Type declaringType = mb.DeclaringType;
bool isAsync = (declaringType != null &&
declaringType.IsDefined(typeof(CompilerGeneratedAttribute)) &&
typeof(IAsyncStateMachine).IsAssignableFrom(declaringType));

// if there is a type (non global method) print it
if (t != null)
if (declaringType != null)
{
// Append t.FullName, replacing '+' with '.'
string fullName = t.FullName;
string fullName = declaringType.FullName;
for (int i = 0; i < fullName.Length; i++)
{
char ch = fullName[i];
Expand Down Expand Up @@ -594,7 +598,8 @@ internal String ToString(TraceFormat traceFormat)
}
}

if (sf.GetIsLastFrameFromForeignExceptionStackTrace())
if (sf.GetIsLastFrameFromForeignExceptionStackTrace() &&
!isAsync) // Skip EDI boundary for async
{
sb.Append(Environment.NewLine);
sb.Append(SR.Exception_EndStackTraceFromPreviousThrow);
Expand Down

0 comments on commit ded78a3

Please sign in to comment.