Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Methods in generic classes cannot be disassembled, even i run mode #58

Closed
poizan42 opened this issue May 25, 2024 · 0 comments · Fixed by #61
Closed

Methods in generic classes cannot be disassembled, even i run mode #58

poizan42 opened this issue May 25, 2024 · 0 comments · Fixed by #61

Comments

@poizan42
Copy link

poizan42 commented May 25, 2024

Example:

using System.Runtime.CompilerServices;

namespace FooBar;

internal class Foo<TBar>
{
    public Foo(TBar bar)
    {
        Bar = bar;
    }
    public TBar? Bar { get; }

    [MethodImpl(MethodImplOptions.NoInlining)]
    public void Frob()
    {
        Console.WriteLine(Bar);
    }
}

internal class Program
{
    static void Main(string[] args)
    {
        Foo<int> foo = new(42);
        foo.Frob();
    }
}

Choosing "Disasm this" on Foo.Frob() results in an empty output, even when Run mode is selected.

Looking at the log makes it pretty obvious why

Executing a command in directory "C:\projects\test\DisasmoTest":
	dotnet build -f net8.0 -c Release -o bin\Release\net8.0\Disasmo-v5.9.2 --no-self-contained /p:RuntimeIdentifier="" /p:RuntimeIdentifiers="" /p:WarningLevel=0 /p:DefineConstants=DISASMO /p:TreatWarningsAsErrors=false "C:\projects\test\DisasmoTest\DisasmoTest.csproj"
Env.vars:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
DOTNET_CLI_TELEMETRY_OPTOUT=1


Executing a command in directory "C:\projects\test\DisasmoTest\bin\Release\net8.0\Disasmo-v5.9.2":
	dotnet "DisasmoTest.dll"
Env.vars:
DOTNET_JitDisasm=*Foo:Frob
DOTNET_TieredPGO=0
DOTNET_JitDisasmDiffable=0
DOTNET_TieredCompilation=0
DOTNET_ReadyToRun=1
DOTNET_TieredPGO_InstrumentOnlyHotCode=0
DOTNET_TC_CallCountingDelayMs=0

*Foo:Frob obviously does not match FooBar.Foo`1[int]:Frob().

It should probably be at least *Foo`1[*:Frob

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant