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

Debugging support #114

Closed
abenedykt opened this issue Oct 29, 2014 · 10 comments
Closed

Debugging support #114

abenedykt opened this issue Oct 29, 2014 · 10 comments
Assignees
Labels
Milestone

Comments

@abenedykt
Copy link

some way to debug a script :)

@abenedykt abenedykt changed the title debugging label:feature debugging Oct 29, 2014
@patriksvensson
Copy link
Member

This is an excellent idea. Have to think a little bit more of how this could be accomplished.

@patriksvensson patriksvensson changed the title debugging Debugging Nov 4, 2014
@patriksvensson patriksvensson changed the title Debugging Debugging support Nov 4, 2014
@ghost
Copy link

ghost commented Mar 31, 2016

@patriksvensson Project scriptcs has a -debug commandline option that allows just that (see documentation here). I gave it a try and it works. The documentation does not refer to it but it is also possible to attach to an existing scriptcs.exe process that is running a .csx script. Might be worth checking how they achieved it technically.

Edit: The trick is probably here in CSharpScriptInMemoryEngine.cs (see LoadAssembly).

@ghuntley
Copy link
Contributor

Alright, I've completed a pretty major unit of work using Cake and the lack of breakpoint debugging, REPL was a definite source of friction as it resulted in many "printf statements and observe outcomes" cycles. Overall, really happy with Cake and would definitely use/recommend others to use it.

Now as for the way forward, I think the right approach would be to take some cues from Python.

http://stackoverflow.com/questions/6980749/simpler-way-to-put-pdb-breakpoints-in-python-code
https://docs.python.org/2/library/pdb.html

cake --debug build.cake

When --debug is set the script will break on the first line of execution and expose a debugger interface that will allow you to progress to the next line of execution and/or poke with roslyn/intermediate window/the stack. If the --debug command line option is not set then Cake execution will progress as expected unless a Breakpoint method which would provide the previously discussed behavior.

@devlead
Copy link
Member

devlead commented Apr 19, 2016

@ttollemer @ghuntley great ideas! I also would love to have this, isn't the core priority currently though, that said would fully back and help test such a contribution to Cake:+1:

@bjorkstromm
Copy link
Member

Here is some interesting read on how this was accomplished in Scriptcs.

@devlead Noticed that this feature have been requested several times in the Gitter chat room. I'm also interested in this feature and interested in implementing it (if it's not already taken). I'll investigate, create a PoC and open a PR when I have something working.

@devlead
Copy link
Member

devlead commented Apr 28, 2016

@mholo65 cool 👍

@gep13
Copy link
Member

gep13 commented Apr 29, 2016

@mholo65 so that we can track this, I have added you as an outside collaborator to this repository, and I have assigned this issue to you. If you end up not being able to look at this, let me know, and I will remove the assign. Thanks!!

@bjorkstromm
Copy link
Member

@gep13 great! I started looking into this yesterday, still not much, but some basics can be found here https://github.com/mholo65/cake/tree/debug-support

@patriksvensson patriksvensson added this to the v0.12.0 milestone May 4, 2016
@devlead
Copy link
Member

devlead commented May 13, 2016

Resolved by #858

@devlead devlead closed this as completed May 13, 2016
@ghuntley
Copy link
Contributor

Holy shitballs. <3

On Fri, 13 May 2016, 5:50 PM Mattias Karlsson notifications@github.com
wrote:

Closed #114 #114.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#114 (comment)

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

No branches or pull requests

6 participants