How to invoke the Debugger?

How do we invoke the Debugger?

I've tried setting playdate.debug.setEnabled(true) in my project code but there is no change in behaviour of the Simulator.

I can get to the Console, Memory Viewer and Sampler but have no idea about the Debugger.

What am I missing?

Thanks!

Any ideas? I feel like a fool :smile:

You can call the playdate.debug functions in the console (there's a text entry field at the bottom of the console window, if you'd missed that) but like Inside Playdate says, this is all experimental, untested code that I wouldn't expect to work correctly. We aren't planning on adding debugger UI to the simulator, but I believe Logan's already done some work on that in Nova.

I'll file a bug to see if we can get those functions working again, though! Our intern added those.. five years ago, I think? :flushed:

1 Like

I have missed it! :playdate_shocked:

And Nova integration, too.

Will check again in the morning. Thanks.

2022 checkin' in!

  • Downloaded the SDK and nova.
  • Open up one of the samples, DrumMachine.
  • Playdate Simulator is preselected as the Task
  • Clicked line number 91 of main.lua, a blue arrow indicator is added to the line as expected
  • Press play in Nova

Expected: The game opens in Simulator and halts immediately at line 91, at which point I can inspect all variables in Nova

Actual: The game opens in Simulator and runs as if no debugger is attached.

In the PlayData simulator Task, I tried both launch types launch and debug. No difference.

For now I'm interested in developing Lua-only

Would also like to know whether it is possible to attach a debugger in the IntelliJ IDE

1 Like

I too would like to know whether this is supposed to work. There's a comment in another thread about debugging which says it used to. I got to the same place you did, have some code, have the extension, clicked on the source and got a blue indicator arrow, ran the code, no debug.

Also at the start of this thread is a comment about setting playdate.debug.setEnabled(true) but there's nothing in the documentation about playdate.debug and adding this line fails so perhaps playdate.debug was also removed

I'm looking and enquiring into this for you (and for me!)

thanks for your patience.

OK! My mistake - I thought it was already out.

I've been informed Playdate debugging is scheduled for the next major version of Nova (9.0), out soon, though I don't know of an exact date for that.