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
{{ message }}
This repository was archived by the owner on Nov 13, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 13, 2026. It is now read-only.
While in the process of debugging #1530, I find that attaching the Visual Studio debugger to ILC is an extremely annoying process. I have to edit ILC's Main() method, add some code that waits for a keypress, and then rebuild CoreRT. The pause for the keypress gives me time to switch back to Visual Studio and Attach to Process after I launch ILC from within PowerShell. However, once the debugging session is done, I have to remove the keypress code and rebuild CoreRT again, because otherwise ILC would crash when invoked from my automated build process. Is there/could there be an easier way to accomplish this? Thanks!
@jkotas I'm afraid not, as if I attach to the process before CoreCLR is initialized, the debugger is of no practical use. From what I gather from the linked post, this would initialize the Visual Studio debugger immediately when the process launches. Visual Studio would then auto-detect native code and attach the C++ debugger. By the time I detach ILC has run to completion before I can reattach using the C# debugger. If there is a way I can tell Visual Studio what debugger flavor to use, then it might work.
@wjk Are you interested in submitting PR with the fix?
The command line option may be called --waitfordebugger so that it is clear what it does and not getting confused with generating debuggable code. A good place to add the implementation of the helper class may be src\Common\src\CommandLine. Thanks.
Activity
jkotas commentedon Jul 16, 2016
Would gflags tool help?
https://social.msdn.microsoft.com/Forums/vstudio/en-US/a164868b-c361-4a5f-a9ef-888058363b93/is-there-a-way-of-making-the-vs-debugger-start-up-directly-when-an-exe-is-run?forum=vsdebug
wjk commentedon Jul 16, 2016
@jkotas I'm afraid not, as if I attach to the process before CoreCLR is initialized, the debugger is of no practical use. From what I gather from the linked post, this would initialize the Visual Studio debugger immediately when the process launches. Visual Studio would then auto-detect native code and attach the C++ debugger. By the time I detach ILC has run to completion before I can reattach using the C# debugger. If there is a way I can tell Visual Studio what debugger flavor to use, then it might work.
jkotas commentedon Jul 16, 2016
Would having debugging aid under switch help? Like https://github.com/dotnet/cli/blob/rel/1.0.0/build_projects/Microsoft.DotNet.Cli.Build.Framework/DebugHelper.cs. I think it should be fine to add.
wjk commentedon Jul 16, 2016
@jkotas That would be perfect.
jkotas commentedon Jul 16, 2016
@wjk Are you interested in submitting PR with the fix?
The command line option may be called
--waitfordebuggerso that it is clear what it does and not getting confused with generating debuggable code. A good place to add the implementation of the helper class may besrc\Common\src\CommandLine. Thanks.wjk commentedon Jul 16, 2016
@jkotas Of course! I’ll get on it as soon as I can.
jkotas commentedon Jul 16, 2016
Fixed by #1532