-
-
Notifications
You must be signed in to change notification settings - Fork 740
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
Add possiblity to launch debugger #876
Comments
@mholo65 is this something that you will be in a position to look at, or would you like one of us to take it? Thanks! |
@gep13 yes, I can look at this. But to make this is as elegant as possible, then at least some bit of Cake.Core (e.g. ICakeEnvironment) needs to know if we are running debug or not. Hence the reference to #902 By doing this we could use same pre-processor directive and the change these BreakDirectiveProcessor.cs lines to: replacement = null;
if (!line.Trim().Equals("#break", StringComparison.Ordinal))
{
return false;
}
if(_environment.IsDebug)
{
replacement = @"if (System.Diagnostics.Debugger.IsAttached) { System.Diagnostics.Debugger.Break(); } else { System.Diagnostics.Debugger.Launch(); }";
}
return true; Result will be that What's your opinion on this? |
@mholo65 I agree, I think we need that before attempting this. @patriksvensson were you planning on attempting #502 in the 0.13.0 release, or should we bump this particular issue onto the next milestone? |
@mholo65 What would the non-elegant solution look like until we've fixed the environment refactoring? |
@patriksvensson well, it's probably by adding a new directive All other solutions would require refactoring of the Autofac module registrations, we have an chicken-egg problem because Core module is loaded first, and then arguments are parsed. A not-so-elegant solution would be to just check arguments for |
@mholo65 I have a submitted PR that should solve that. Did some refactoring gor the module support. However, checking if --debug is present should be ok for now. We can always refactor later. |
@patriksvensson @gep13 ok, then I'll try to get something done... What's the schedule for v0.13.0? |
@mholo65 we are hoping to get something out before Thursday, which is when I am doing a talk at NDC. If that is unrealistic, please don't feel any pressure to try to get this done. |
Maybe we can move this to v0.14.0 so there's no stress. |
yep, move to v0.14.0, even if I start working on it today, Thursday is a bit unrealistic when taking review + testing into account. |
@mholo65 done. Thanks again for helping out! |
@mholo65 given the work that @patriksvensson has been doing on getting the CoreClr port of Cake to where it is, I am going to defer this work until after that is released. Hope that makes sense. |
Not needed. |
Once PR #858 is merged, it might be useful to have the possibility to let Cake.exe launch a debugger using System.Diagnostics.Debugger.Launch() instead of waiting for debugger to be attached.
Maybe waiting for debugger to be attached could be canceled by user, and then on #debug pre-processor directive (as mentioned in issue #869) we could do Debugger.Launch() if debugger isn't attached...
The text was updated successfully, but these errors were encountered: