-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Disallow inlining Main #94449
Disallow inlining Main #94449
Conversation
When we compile managed code, `Main` is not the actual spot where execution of managed code starts. Instead it's the `StartupCodeMain` method that the compiler generates. This method is responsible for initializing the managed environment, calling `Main` and tearing down the environment. If `Main` is short enough, sometimes it gets inlined into `StartupCodeMain` this has bad impact on diagnostics (don't see `Main` in stack traces, can't set breakpoints). Pretend it was marked `NoInlining`.
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas Issue DetailsWhen we compile managed code, Cc @dotnet/ilc-contrib
|
Yeah it was annoying that |
src/coreclr/tools/aot/ILCompiler.RyuJit/JitInterface/CorInfoImpl.RyuJit.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
…pl.RyuJit.cs Co-authored-by: Jan Kotas <jkotas@microsoft.com>
src/coreclr/tools/aot/ILCompiler.Compiler/IL/Stubs/StartupCode/StartupCodeMainMethod.cs
Outdated
Show resolved
Hide resolved
…/StartupCodeMainMethod.cs
When we compile managed code,
Main
is not the actual spot where execution of managed code starts. Instead it's theStartupCodeMain
method that the compiler generates. This method is responsible for initializing the managed environment, callingMain
and tearing down the environment. IfMain
is short enough, sometimes it gets inlined intoStartupCodeMain
this has bad impact on diagnostics (don't seeMain
in stack traces, can't set breakpoints). Pretend it was markedNoInlining
.Cc @dotnet/ilc-contrib