src/AsyncDbg.Core/Causality/AsyncStateMachineNode.cs
/// <summary>
/// Returns a task instance that the current state machine awaits on.
/// </summary>
Returns a task instance that the current state machine awaits on.
Returns a task instance that the current state machine awaits on .
private ClrInstance? GetAwaitedTask()
        {
            foreach (var field in ClrInstance.Fields)
            {
                if (field.Field.Name.StartsWith("<>u__"))
                {
                    var taskInstance = field.Instance.TryGetFieldValue("m_task")?.Instance;
                    if (taskInstance?.IsNull == false)
                    {
                        return taskInstance;
                    }
                }
            }
            return null;
        }
private ClrInstance ? GetAwaitedTask ( ) { foreach ( var field in ClrInstance . Fields ) { if ( field . Field . Name . StartsWith ( " " ) ) { var taskInstance = field . Instance . TryGetFieldValue ( " " ) ? . Instance ; if ( taskInstance ? . IsNull == false ) { return taskInstance ; } } } return null ; }
Returns a task instance that the current state machine awaits on.
Returns a task instance that the current state machine awaits on .
// Async state machine could have more then one task awaiter, and in order to find the right one // we just look for all <>u__ fields that have non-default value of task awaiter.