midouest / vscode-playdate-debug

Unofficial Playdate debug extension for Visual Studio Code on macOS, Windows and Ubuntu
https://marketplace.visualstudio.com/items?itemName=midouest.playdate-debug
MIT License
38 stars 4 forks source link

Debugging C projects #32

Closed Riari closed 1 year ago

Riari commented 1 year ago

Hi,

Would it be possible to debug projects written in C? I'm using the Sprite Game example from the SDK's C_API directory to test with it, and while I can get a debug build running in the simulator, attempting to launch the game with this extension causes it to exit silently (neither the simulator console nor the client/server debug log generated by the extension give any indication as to why).

My understanding is that this extension only supports Lua projects, so I'm not surprised it doesn't work for C, but I'd like to know what it would take to add support for that. Happy to contribute with a PR if you can give me some pointers!

Thanks

midouest commented 1 year ago

This would be a large undertaking. I think it's better to use existing extensions such as Makefile Tools or CMake Tools rather than trying to include the same functionality in this extension.

At one point I had a mixed C/Lua project that I was able to debug using both this extension and CMake Tools. I've forgotten how I did it, but I'll try to create an example that others can use.

midouest commented 1 year ago

Duplicates #27

Riari commented 1 year ago

Thanks for clarifying! I'll try your suggestion and see how far I get. An example would be great if you can find the time for it, but if I figure it out myself in the meantime, I'll share the details here (or in a separate issue if preferred).

midouest commented 9 months ago

Here's a guide on how to configure VSCode to build/debug both C and Lua code: https://devforum.play.date/t/guide-debugging-mixed-lua-c-projects-with-vscode/15473

Riari commented 9 months ago

Amazing, thank you for the update! I'll try it out.