I think a debugger isn’t essential for this to be a useful tool, but for a version 2.0 I do think it’d be nice to have one. Personally, I do seem to spend a lot of my time debugging, so if the projucer could do that, I’d find it much more useful. I guess everyone will differ in the amount of importance they give to debugging.
Really? You must have more luck than me - I’ve very rarely been able to get edit-and-continue working!
This is a very different approach though… the projucer actually modifies the code before running it to allow those realtime value injections, and it adds extra generated code to allow individual components to be instantiated without actually launching the app in the normal way. It also provides a much shorter turnaround time for changes that do require a recompile.
And the main thing that edit-and-continue can never provide is the GUI editor. All the editing controls that you see inside the floating window (i.e. all the controls that highlight the selected child, drag it around, show its properties, etc) is running inside the JIT - the app actually generates and compiles the code that edits a component, so that it can integrate directly with the real component.
[quote]I wonder if the current demo hold the “state” of the application when applying the changes in the code ?
I mean, let’s take the example of the Juce’s Demo, if I run the Projucer on the demo, navigate to whatever component, and then change some values in the code for that component, will it update in the component I’m seeing, or, will I need to navigate to the same component like if the main process was restarted ?[/quote]
At the moment there are two types of change:
- literal changes, which are instantaneous (just updating the value in memory)
- changes that need a recompile, which have to restart the JIT and create a new instance of the component (generally all done with about 2sec)
But LLVM does provide a mechanism for updating the code for individual functions without stopping the JIT - I just haven’t investigated that yet. Updating code without relaunching could easily cause crashes, but that’s not a big deal, because when the JIT crashes, the projucer just launches a new process, which takes maybe 5-ish seconds. So in future, I hope that it’ll be to recompile, figure out if the changes only occurred within one function, and if so, update it without stopping, which should be possible within about 0.5sec.