How to setup ZeroBraneStudio for debug?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
Imaculata
Party member
Posts: 102
Joined: Mon Aug 10, 2015 2:51 pm

How to setup ZeroBraneStudio for debug?

Post 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?
User avatar
beforan
Prole
Posts: 10
Joined: Sat Dec 15, 2012 1:15 pm
Location: Nottingham, UK

Re: How to setup ZeroBraneStudio for debug?

Post 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.
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 2 guests