Skip to content

Portable PDB: AsyncMethodBodyDebugInformation API is incorrect #462

@tmat

Description

@tmat

The current API is

class AsyncMethodBodyDebugInformation
{
  public InstructionOffset CatchHandler { get; set; }
  public Collection<InstructionOffset> Yields { get; }
  public Collection<InstructionOffset> Resumes { get; }
  public MethodDefinition MoveNextMethod { get; set; }
  public CustomDebugInformationKind Kind { get; }
}

but should be:

class AsyncMethodBodyDebugInformation
{
  public InstructionOffset CatchHandler { get; set; }
  public Collection<InstructionOffset> Yields { get; }
  public Collection<InstructionOffset> Resumes { get; }
  
  // This is the method where the state machine execution resumes at corresponding resume offset.
  // Currently the C# and VB compilers always resume in MoveNext method, but that's might change in future. The debug information encodes an array of tokens, not a single token.
  public Collection<MethodDefinition> ResumeMethods { get; set; }

  public CustomDebugInformationKind Kind { get; }
}

See implementation: https://github.com/dotnet/symreader-portable/blob/610fc42a0f04f10696a11f816d3d3d5365df74e0/src/Microsoft.DiaSymReader.PortablePdb/SymMethod.cs#L377

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions