dotnet / dotnet/diagnostics

!bpmd doesn't work on explicit interface methods

Open
#5,777 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C++
Stars
1.3k
Forks
404
Avg merge
2d 3h
Merged PRs (30d)
38

Description

For example, if I have the following code taken from the docs:
```csharp
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 https://github.com/dotnet/runtime/pull/125539

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.