Using breakpoints with LUA code

Yes the only debugging anyone seems to have been able to do is in Nova which has/had hooks for it. However if you flip over to this thread How to invoke the Debugger? - #8 by matt you can see matt has kindly responded that debugging will be in the NEXT version of Nova (which means I just blew my free 30 day trial sob sob). So i don't think there's a way to debug Lua for playdate at all on any platform at this point.

At the point that Nova support for it comes out I'm hoping there will be enough documentation about the hooks for someone to write quick vscode extension for this as well.

1 Like

I’m developping my game with Lua. I’m using the Nova beta for breakpoints and debugging and it works well for me so far. There used to be a link toward a beta version of Nova here but I can’t find it anymore. I was confirmed some time ago that breakpoints and debugger only works on the beta, not the regular version.

1 Like

Nova 9 is now out, with debugging support.

1 Like

.. and works exactly as you'd hope. Thanks very much. So now we have a way to debug Lua on MacOS at least (which works for me). I will ask if the debug API might make it into documentation one day so that perhaps a debug module could be written for vscode.

1 Like

I suspect next public SDK will have updated docs.

I will ask if the debug API might make it into documentation one day so that perhaps a debug module could be written for vscode.

The Playdate Simulator responds to the Debug Adapter Protocol.

Here's a Playdate debugger extension for VS Code I hacked together last night: Playdate Debug - Visual Studio Marketplace

There are currently a couple known issues that I am still trying to sort out:

  • VS Code continues to display a progress bar after connecting to the debugger. The progress bar goes away after a breakpoint is hit.
  • An error message is displayed after clicking the stop button the first time. Clicking the stop button a second time correctly stops the game in the Simulator. Alternatively, hold the alt/option key when clicking the stop button to change it to a "disconnect" button.
8 Likes

I've been using Lua debug with the beta for quite some time now and it works well. So I assume Nova 9 should be even better. Time to switch out from the beta branch!

2 Likes

Looks like the VSCode debugger extension does not work on Windows at the moment.

Panic devs, does the Playdate Simulator run the Debug Adapter Protocol on Windows/Linux?

I've tried extension in Ubuntu @midouest. Working nicely :playdate:, minus the debugging as stated :playdate_dizzy:.

Any update on this?

1 Like

Only the Mac Simulator supports the Debug Adapter Protocol at the moment. It is on my to-do list to get it into the Windows and Linux sim soon.

4 Likes

Is it already in 11.0 SDK?

Sorry to bother, but any update on this?

I stopped developing a couple of months ago, primarily because I didn't want to deal with hacking my code and adding on console print lines instead of using a proper debugger.

Surfing the forums I can't see if it's been implemented.

@IGM0937 I'm actively working on this and hopefully will make it into the next release, thanks for your interest!

7 Likes

Hi! Can you confirm there's no way to use breakpoints with LUA on Windows? It seems to be the case, both from my experience and from reading the answers to this thread.
Thanks!

Not currently. The next release of the SDK out soon will include it.

4 Likes

Thanks for your answer! Is there an ETA for next release of the SDK?

No ETA other than "Soon." :slight_smile:

Ok, got it! :stuck_out_tongue: Thanks!

Hi, is it possible to debug playdate lua yet in Windows/vscode? Thanks

Hi everybody :slight_smile: Is it possible to use breakpoints with LUA on Windows currently? Is there any documentation/tutorial about it? Thanks in advance.