Update for new frameworks

This commit is contained in:
Ben Adams
2021-01-03 15:51:28 +00:00
parent a5ae4e6391
commit 6d7a54cd84
5 changed files with 60 additions and 8 deletions

View File

@@ -663,8 +663,13 @@ namespace System.Diagnostics
{
return false;
}
if (type == typeof(Task))
if (type == typeof(Task) || type.DeclaringType == typeof(Task))
{
if (method.Name.Contains(".cctor"))
{
return false;
}
switch (method.Name)
{
case "ExecuteWithThreadLocal":
@@ -672,15 +677,24 @@ namespace System.Diagnostics
case "ExecutionContextCallback":
case "ExecuteEntry":
case "InnerInvoke":
case "ExecuteEntryUnsafe":
case "ExecuteFromThreadPool":
case "s_ecCallback":
return false;
}
}
if (type == typeof(ExecutionContext))
{
if (method.Name.Contains(".cctor"))
{
return false;
}
switch (method.Name)
{
case "RunInternal":
case "Run":
case "RunFromThreadPoolDispatchLoop":
return false;
}
}

View File

@@ -60,9 +60,8 @@ namespace System.Diagnostics
}
var genericPartIndex = type.Name.IndexOf('`');
Debug.Assert(genericPartIndex >= 0);
return type.Name.Substring(0, genericPartIndex);
return (genericPartIndex >= 0) ? type.Name.Substring(0, genericPartIndex) : type.Name;
}
private static void ProcessType(StringBuilder builder, Type type, DisplayNameOptions options)