Skip to content

!bpmd doesn't work on explicit interface methods #5777

@rcj1

Description

@rcj1

For example, if I have the following code taken from the docs:

namespace X.Y.Z;

public interface IControl
{
    void Paint();
}
public interface ISurface
{
    void Paint();
}
public class SampleClass : IControl, ISurface
{
    void IControl.Paint()
    {
        System.Console.WriteLine("IControl.Paint");
    }
    void ISurface.Paint()
    {
        System.Console.WriteLine("ISurface.Paint");
    }
}

internal static class Program
{
    private static void Main()
    {
        SampleClass sample = new SampleClass();
        IControl control = sample;
        ISurface surface = sample;

        // The following lines all call the same method.
        //sample.Paint(); // Compiler error.
        control.Paint();  // Calls IControl.Paint on SampleClass.
        surface.Paint();  // Calls ISurface.Paint on SampleClass.
    }
}

and try to set a breakpoint via !bpmd console.dll X.Y.Z.SampleClass.IControl.Paint, we do not break on it.
Runtime: latest main
TFM: net11.0

Found while working on dotnet/runtime#125539

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions