## ZeroBrane 0.9 Debugging Issues

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Andynonomous
Prole
Posts: 13
Joined: Sat Sep 20, 2014 7:42 pm

### ZeroBrane 0.9 Debugging Issues

Hello,

I've been looking at ZeroBrane lately and it made me remember how much I love having a debugger. However I still run into problems where I lose track of where my program is. The green indicator disappears and it seems as if debugging has stopped.

I've gone through the faq and I've tried my best to address all the things it talks about in reference to these kinds of issues but still these situations arise where I've lost my track of my debugger. I have ZB successfully auto-opening files for me, and I use the 'pause at next executed line of code' option, but there are points in my program that I just can't seem to reach.

If anyone can think of anything I might be missing I would really appreciate it! I love lua, and I really want to be able to use this debugger. Thanks in advance!

Sosolol261
Party member
Posts: 125
Joined: Wed Nov 26, 2014 6:43 am

### Re: ZeroBrane 0.9 Debugging Issues

I think it means, that your code has no errors or so..

paulclinger
Party member
Posts: 221
Joined: Thu Jun 28, 2012 8:46 pm

### Re: ZeroBrane 0.9 Debugging Issues

Andynonomous wrote:I've been looking at ZeroBrane lately and it made me remember how much I love having a debugger. However I still run into problems where I lose track of where my program is. The green indicator disappears and it seems as if debugging has stopped.
I've tried to remove all the ambiguity as to what the status of the debugger really is. The Output window will change its label to "Output (running)" when the application is running and to "Output (suspended)" when the application is suspended in the debugger. When the application is "suspended" in the debugger, you should see a green arrow in most cases, but there are situations when it's not possible to show it. For example, if you use "Break" button to suspend the debugging, the debugger will try to stop as soon as possible and if it happens in one of the files that is not opened (or can't be opened), you'll see a message like "Debugging suspended at file:line (couldn't activate the file)." without any green marker.

In general, if the Output window label says "Output", it means the running/debugging is over and you'll see messages in the Output window that detail what happened. Love2d will show the run-time errors, unless you handle them with pcall(), in which case it may seem like the application continues, but nothing happens.

If you still can't figure out what happens with the debugger, I can try to check with the code you have to see what may be going on... Paul.

Andynonomous
Prole
Posts: 13
Joined: Sat Sep 20, 2014 7:42 pm

### Re: ZeroBrane 0.9 Debugging Issues

Thank you, I appreciate the response. And for all your work in creating zerobrane! A couple questions perhaps. When you see the 'suspended' message, is there any way to emerge from that and continue? I notice that I keep getting caught up in boot.lua.

Is it a bad idea to put the 'debug.start()' (assuming debug was assigned properly with the if arg... line) call somewhere other than in love.load? Are there commands other than start()?

Thanks again!

paulclinger
Party member
Posts: 221
Joined: Thu Jun 28, 2012 8:46 pm

### Re: ZeroBrane 0.9 Debugging Issues

Andynonomous wrote:Thank you, I appreciate the response. And for all your work in creating zerobrane! A couple questions perhaps. When you see the 'suspended' message, is there any way to emerge from that and continue? I notice that I keep getting caught up in boot.lua.
If the debugger is in "suspended" state, you can always use Continue/F5 (the green arrow icon on the toolbar), which should be enabled. This will continue the debugging until the breakpoint is hit or you suspend the application by using "Break".

> Is it a bad idea to put the 'debug.start()' (assuming debug was assigned properly with the if arg... line) call somewhere other than in love.load?

No; you can put debug.start() anywhere you want. Obviously, the debugging is going to be enabled only when that command is executed, but there should be no restrictions on where it can be used. For example, you can put it in a keypress handler. Keep in mind though that the debugging will stay active even after you exit that handler unless you use require('mobdebug').off() or require('mobdebug').done(). You can use start() multiple times and it won't do anything if the debugging is already started. See this documentation page for some details: http://studio.zerobrane.com/doc-lua-debugging

> Are there commands other than start()?

There is loop() command that is used to load scripts into the debugger, but it's not going to work with love2d scripts because of their project structure. There is also scratchpad() command that is used in live coding.

Andynonomous
Prole
Posts: 13
Joined: Sat Sep 20, 2014 7:42 pm