Page 1 of 1

How to setup ZeroBraneStudio for debug?

Posted: Wed Aug 12, 2015 7:11 pm
by Imaculata
As the thread title reads, how do I get ZeroBraneStudio properly configured so debugging works? Is it compatible with the latest version of LOVE at all?

I've reached that point where errors start popping up in tables, and I have no idea what is going wrong. So I need a way to trace the problem, and inspect what state variables were in before things went south.

I installed ZeroBraneStudio (on my laptop running Windows 7), because it came recommended on these forums. I set the interpreter to LOVE, and set the project folder to that of the current project I'm working on. But when I run the project in debug mode, I can't do any debug stuff. So how does it work? Is something configured wrong?

When the project crashes, how do I inspect variables and find the culprit?

Re: How to setup ZeroBraneStudio for debug?

Posted: Thu Sep 17, 2015 2:18 pm
by beforan
Not sure if you're still having trouble with this; I stumbled across your post while searching for another thread ;)

ZeroBrane's website does have instructions on setting it up for debugging with various interpreters.

For LÖVE you need to add a parameter for arguments to love.load() and then include ZeroBrane's debug module if the arguments contain the -debug switch!

It looks something like this:

Code: Select all

function love.load(arg)
  if arg[#arg] == "-debug" then require("mobdebug").start() end --zbstudio LOVE debugging
  
  -- your precious code here...
end
Then it will respect your breakpoints and allow adding variables to the watch window and stuff.