You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Methods can overlap, for example lambda bodies inside methods. An interesting case is that all instance fields initializers are unified into the constructor method, and the span of that ctor method starts at the beginning of the first field to the end of the last field (or the actual constructor itself). Same for static ctor.
Because of the way the overlapping methods are split into "layers" by PartitionToNonOverlappingSubsequences the methods with a smaller span usually end up in higher layers.
The current logic seems to pick the method that appears higher in the metadata table. Instead, it should pick the method with the smaller span (distance between the first and the last line). I think this is always just the last method.
I know that the correct way to do this is to use the GetMethodsFromDocumentPosition and then select the best match yourself, but feels like GetMethodFromDocumentPosition could always reliably return the correct method and it currently doesn't.
Microsoft.DiaSymReader.PortablePdb.dll!Microsoft.DiaSymReader.PortablePdb.SymReader.GetMethodFromDocumentPosition Line 498
The text was updated successfully, but these errors were encountered:
This logic to pick a single method from a line doesn't always return the best method and depends on the order of methods in the metadata table.
symreader-portable/src/Microsoft.DiaSymReader.PortablePdb/SymReader.cs
Lines 490 to 496 in b61c277
Methods can overlap, for example lambda bodies inside methods. An interesting case is that all instance fields initializers are unified into the constructor method, and the span of that ctor method starts at the beginning of the first field to the end of the last field (or the actual constructor itself). Same for static ctor.
Because of the way the overlapping methods are split into "layers" by
PartitionToNonOverlappingSubsequences
the methods with a smaller span usually end up in higher layers.The current logic seems to pick the method that appears higher in the metadata table. Instead, it should pick the method with the smaller span (distance between the first and the last line). I think this is always just the last method.
I know that the correct way to do this is to use the
GetMethodsFromDocumentPosition
and then select the best match yourself, but feels likeGetMethodFromDocumentPosition
could always reliably return the correct method and it currently doesn't.The text was updated successfully, but these errors were encountered: