Don't optimize away Task code needed for debugger (#17776)
authorChuck Ries <chuckr@microsoft.com>
Wed, 25 Apr 2018 23:06:49 +0000 (16:06 -0700)
committerJan Kotas <jkotas@microsoft.com>
Wed, 25 Apr 2018 23:06:49 +0000 (16:06 -0700)
This prevents the IL linker from optimizing away some properties/methods
related to tasks that are used by a debugger but are not referenced
anywhere else in coreclr.

This specifically fixes async callstack frames for the xplat C# debugger.

src/mscorlib/ILLinkTrim.xml

index 3f81750..8c1071d 100644 (file)
@@ -9,6 +9,7 @@
     <type fullname="System.Threading.Tasks.Task">
       <property name="ParentForDebugger" />
       <property name="StateFlagsForDebugger" />
+      <method name="GetDelegateContinuationsForDebugger" />
     </type>
     <type fullname="System.Threading.ThreadPool">
       <method name="GetQueuedWorkItemsForDebugger" />
       <method name="GetScheduledTasksForDebugger" />
       <method name="GetTaskSchedulersForDebugger" /> 
     </type>
+    <type fullname="System.Runtime.CompilerServices.AsyncMethodBuilderCore">
+      <method name="TryGetStateMachineForDebugger" />
+    </type>
+    <type fullname="System.Runtime.CompilerServices.AsyncVoidMethodBuilder">
+      <property name="ObjectIdForDebugger" />
+    </type>
+    <type fullname="System.Runtime.CompilerServices.AsyncTaskMethodBuilder*">
+      <property name="ObjectIdForDebugger" />
+    </type>
     <type fullname="System.Threading.Tasks.Task">
       <!-- Methods is used by VS Tasks Window. -->
       <method name="GetActiveTaskFromId" />