Has anyone figured out how to enable debugging, breakpoints etc using VSCode? I can see people have figured it out for Visual Studio (full) here Helpful Tip: Visual Studio Debugging
I am running VSCode on OSX.
Has anyone figured out how to enable debugging, breakpoints etc using VSCode? I can see people have figured it out for Visual Studio (full) here Helpful Tip: Visual Studio Debugging
I am running VSCode on OSX.
I haven't done it personally, but you can use the Makefile VSCode plugin (provided by Microsoft) and set it up to run and debug in VSCode. Here is a good write up on getting it set up. If you're looking for Lua instructions, they are here.
Tried both of these suggestions. Both of them let you start the simulator from within VSCode but neither let you attach the debugger.
You'd have to set your compilerPath
in your VSCode properties file to gcc but then launch the Simulator with the game path as the arguments going to gcc. If I have time I'll mess with it a bit tomorrow and see if I can get it working. That said, you can use Xcode on macOS to debug games which is a bit more straight forward.
I was able to get this to work. My approach was:
I had trouble with this - I'm on an ARM mac (if that makes a difference). Building was ok but using the standard debug target (cppdbg) I think the debugger launches the emulated x86_64 playdate sim (you get a message about target architecuture) and then you can't load the arm64 compiled dylib.
I tried setting targetArchitecture to "arm64" and that makes the message go away but the simulator still fails to load the dylib with a console message that it's a mach.o file but still the wrong architecture.
Possibly if you used an exernal run target instead of a cppdbg it might work, not sure. I do have the CodeLLDB extension installed and running under (the target type is lldb) was much more successful. It also loaded way way faster.
VSCode does look like a pretty good platform for building and running playdate, I still need to get the C stuff configured properly to find header files etc and sort out a workflow I like.
yes confirmed even with the targetArchitecture set the cppdbg command still loads the intel version of the simulator from the bundle so on an M1 mac that doesn't work.
and one more thing - this was actually fixed two days ago in 1.9.3 of the VSCode C++ extension, so if you switch to that pre-release version and set "targetArchitecture":"arm64" it now loads the arm64 version of the simulator, the dylib loads properly and the breakpoints work.