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

Parameter name stripping breaks debugger #102873

Closed
MichalStrehovsky opened this issue May 30, 2024 · 2 comments · Fixed by #105714
Closed

Parameter name stripping breaks debugger #102873

MichalStrehovsky opened this issue May 30, 2024 · 2 comments · Fixed by #105714
Assignees
Labels
area-Tools-ILLink .NET linker development as well as trimming analyzers in-pr There is an active PR which will close this issue when it is merged
Milestone

Comments

@MichalStrehovsky
Copy link
Member

We've been weary of doing optimizations that might affect debuggability, such as stripping unused properties. On the other hand, we strip parameter names. The following program:

class Program
{
    static void Main()
    {
        Test(null, null, null);
    }

    static void Test(string a, string b, string c)
    {
        string d = a;
        KeepLocal(ref d);
    }

    static void KeepLocal<T>(ref T t) { }
}

Looks like this under debugger:

image

We should probably decide whether we're fine breaking debugger and either stop doing this optimization unless DebuggerSupport is false, or open floodgates to more optimizations like this.

@MichalStrehovsky MichalStrehovsky added the area-Tools-ILLink .NET linker development as well as trimming analyzers label May 30, 2024
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label May 30, 2024
Copy link
Contributor

Tagging subscribers to this area: @agocke, @sbomer, @vitek-karas
See info in area-owners.md if you want to be subscribed.

@sbomer
Copy link
Member

sbomer commented May 30, 2024

Thanks for pointing this out! Putting it under DebuggerSupport would make sense to me.

@agocke agocke added this to the 9.0.0 milestone May 30, 2024
@jeffschwMSFT jeffschwMSFT removed the untriaged New issue has not been triaged by the area owner label Jun 3, 2024
@sbomer sbomer self-assigned this Jun 7, 2024
@sbomer sbomer added the in-pr There is an active PR which will close this issue when it is merged label Jul 31, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Sep 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Tools-ILLink .NET linker development as well as trimming analyzers in-pr There is an active PR which will close this issue when it is merged
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants