Page 3 of 5

Re: Löve debugging with ZeroBrane Studio

Posted: Thu Jul 05, 2012 3:55 pm
by paulclinger
bartbes wrote:It might be interesting to see if a dynamic step size could be implemented, i.e. set it to go 100 lines by default, but if it sees that there's a breakpoint coming up in 30, temporarily set it to less, so you can get there. Now, with calls and all this would be incredibly hard to get right, but even if it only works sometimes it might just be good enough for finding weak points.
It's an interesting suggestion, but it is likely to be difficult to implement (to find out when a breakpoint is "coming up") and, more importantly, any additional processing is making the execution slower yet as it happens in every debug_hook.

In terms of other speed ups, it may be possible to only run call/return hooks (and avoid using the "line" hook in this case), but it means that breakpoints will only work on a last and first line in a function (plus some other constraints), but it should run a bit faster.

Re: Löve debugging with ZeroBrane Studio

Posted: Thu Jul 05, 2012 4:02 pm
by paulclinger
Lap wrote: it would also be nice to be able to take the "jump to function" drop down and optionally sort it alphabetically.
The current order has an advantage of showing the structure of the file "at a glance" and also of putting "local" functions relative to other functions where they are defined.

To make it a bit more useful, I've been thinking about making the drop down more powerful by allowing users to type text and to search for that particular fragment in a list (or a line number); maybe also allow quick navigation to show the fragment each line in the dropdown points to.

Re: Löve debugging with ZeroBrane Studio

Posted: Thu Jul 05, 2012 4:43 pm
by bartbes
paulclinger wrote: In terms of other speed ups, it may be possible to only run call/return hooks (and avoid using the "line" hook in this case), but it means that breakpoints will only work on a last and first line in a function (plus some other constraints), but it should run a bit faster.
Not necessarily the case, if you can find which function you're in, you can do line hooks for just that function.

Re: Löve debugging with ZeroBrane Studio

Posted: Thu Jul 05, 2012 5:06 pm
by paulclinger
bartbes wrote:Not necessarily the case, if you can find which function you're in, you can do line hooks for just that function.
I thought so too, but it proved to be challenging (if at all possible). Either the line hook is already installed (then it will have most or all of the processing it currently has) or it's not. If the hook is not installed, I can't install it during debugging as any changes to debug hook running *from* the debug hook are simply ignored. So, you can't install call/return hook and then have a check in that hook to add a line hook when needed. That's why I suggested adding "stop" method (or "on"/"off" methods) as I can add/remove hooks when running from the user script.

Essentially, all the work in the debugger happens inside the debug hook (there is switching between different coroutines, but from Lua's perspective it seems to be still "inside" the debug hook) and no modification to the debug hook is allowed in that context.

Re: Löve debugging with ZeroBrane Studio

Posted: Thu Jul 05, 2012 5:10 pm
by kclanc
Lap wrote: I also don't know if I'll be able to tolerate the speed decrease (0.1-2% of normal speed). That's a pretty brutal slow down and I don't remember Decoda having such issues.
If you're interested in a more efficient debugger, you might want to try love studio. Love studio will not degrade performance much unless breakpoints have been set. And even when breakpoints have been set, the degradation isn't so bad.

Re: Löve debugging with ZeroBrane Studio

Posted: Mon Jul 09, 2012 4:44 am
by paulclinger
Santos wrote:Congratulations! :awesome:

While admittedly I also can't imagine using anything other than Vim for now (until Light Table is released), I would guess that debugging support will be useful for a lot of people. Live coding could also be a compelling use case. Do the number sliders work with LÖVE? LICK may be of interest.
I got the live coding and the sliders working with Löve. You will need to get the current version from the repository (https://github.com/pkulchenko/ZeroBraneStudio); this functionality will be included in the next release. I'm also working on a screencast, and will post a message when it's ready.

Re: Löve debugging with ZeroBrane Studio

Posted: Tue Jul 31, 2012 12:45 am
by paulclinger
Based on the earlier discussion, I've added on/off methods to the debugger to wrap a fragment you want to debug (and turn debugging off for the rest of the code). I've tested it on something complex (like zoetrope and a couple of games) and the performance is the same as with running without the debugger (as the debug hook is only on for those commands that are between require("mobdebug").on() and require("mobdebug").off() calls). The user can add a breakpoint or "break" the application to use other debugging functions.

[update] This code has been included in the latest version.

Re: Löve debugging with ZeroBrane Studio

Posted: Sun Aug 05, 2012 10:40 pm
by klembot
Just to chime in belatedly, if you set STRICT to true in Zoetrope, it prints warnings whenever code refers to a global variable set to nil, on the theory that this is probably a mistake on the coder's part. https://bitbucket.org/klembot/zoetrope/ ... lua#cl-103 for the details.

Without trying it out yet, this project looks really cool! I could see the use case, even as someone who loves vim, that I would not mind running this in parallel just to debug problems.

Re: Löve debugging with ZeroBrane Studio

Posted: Wed Aug 22, 2012 12:47 am
by paulclinger
klembot wrote:Without trying it out yet, this project looks really cool! I could see the use case, even as someone who loves vim, that I would not mind running this in parallel just to debug problems.
Thank you, klembot! As promised, I published the screencast that demonstrates live coding with Löve scripts: http://notebook.kulchenko.com/zerobrane ... -with-love.

Re: Löve debugging with ZeroBrane Studio

Posted: Mon Jan 28, 2013 3:38 pm
by WarpEnterprises
Thanks very much for ZBS, I have some points I can't get to work as I would expect:

* when using Project->Start debugging, it always stops at the ...require("mobdebug").start()... line, although there is no breakpoint there.
* I can't toggle a breakpoint while love is running - is this intentionally?
* is there a keyboard shortcut for adding a selected text to the watch window?