[Swift, Xcode, Playgrounds] Using the debugger with playgrounds

Originator:janoschhildebrand
Number:rdar://17731602 Date Originated:18-Jul-2014
Status:Duplicate of 17553255 (Open) Resolved:
Product:Developer Tools Product Version:Xcode 6 - Beta 3 (6A254o)
Classification:Feature Request Reproducible:NA
 
Summary:
Playgrounds are great for testing ideas and work great for very small examples.

However once the code one is working on reaches a certain level of complexity having the ability to use the debugger to set breakpoints, inspect state and watch the control flow of the program unfold is simply an invaluable tool.

For one example playground (about ~350 lines currently) I find myself copying the contents to a small command-line project in Xcode to use the debugger every 2 hours or so, quickly discovering and fixing the issue and returning to the playground for the nice interactive environment.

Thus I propose allowing use of the debugger with playgrounds. Of course there might be significant technical challenges or you might find this is too much at odds with the playground concept - this would be merely nice to have.

I think it would also work reasonably well with the playgrounds REPL style execution. Setting a breakpoint might immediately re-run the playground code with breakpoints enabled. While the playground is stopped in the debugger, changes to the source code would then *not* be immediately recompiled and re-run but instead there would be an additional command/button in the playground debugger for restarting/re-running the playground.

Steps to Reproduce:


Expected Results:


Actual Results:


Version:
Xcode 6 - Beta 3 (6A254o)
Swift version 1.0 (swift-600.0.38.7)
OS X 10.10 (14A283o)

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!