-
Notifications
You must be signed in to change notification settings - Fork 262
Open
Description
While working on dotnet/BenchmarkDotNet#2843, I found that using DataTarget.CreateSnapshotAndAttach in the same process fails to disassemble properly only on Windows and CoreCLR (.Net 8 in my case). It works fine in .Net Framework, and it also works fine in Linux. Thankfully it works with AttachToProcess in Windows, so I can use that as a workaround, but I figured I should raise this issue.
I tried 3.1.512801 and 4.0.0-beta.24360.3, same behavior on both.
The test that failed:
public class Generic<T> where T : new()
{
[Benchmark]
public T Create() => new T();
}
[Theory]
[MemberData(nameof(GetAllJits), DisableDiscoveryEnumeration = true)]
[Trait(Constants.Category, Constants.BackwardCompatibilityCategory)]
public void CanDisassembleGenericTypes(Jit jit, Platform platform, IToolchain toolchain)
{
if (OsDetector.IsMacOS()) return; // currently not supported
var disassemblyDiagnoser = new DisassemblyDiagnoser(
new DisassemblyDiagnoserConfig(printSource: true, maxDepth: 3));
CanExecute<Generic<int>>(CreateConfig(jit, platform, toolchain, disassemblyDiagnoser, RunStrategy.Monitoring));
var result = disassemblyDiagnoser.Results.Values.Single();
Assert.Empty(result.Errors);
Assert.Contains(result.Methods, method => method.Maps.Any(map => map.SourceCodes.OfType<Asm>().Any()));
}Metadata
Metadata
Assignees
Labels
No labels