Since a while back I have made the `frobd` target in frobtads compatible with the debugger adapter protocol (DAP). This means you are now able to debug tads3 programs from within the vscode-tads3tools together with the binary `frobd`.
I’ve made a pull request to the main repository for frobtads, yet I still await an answer from the maintainer. Since several months now has passed I am not even sure he is even active anymore. That’s why I at least would like you know of its existence.
It’s in the following repo+branch, ready to be built with cmake/make:
https://github.com/toerob/frobtads/tree/frobd_dap_debugger
There is also a terminal debugger similar to gdb/lldb ready to be built in the following branch (which also contains the dap support):
https://github.com/toerob/frobtads/tree/frobd_dap_and_terminal_debugger
The terminal debugger can debug a game file standalone. It needs though to run in plain mode. No curses support. (frobd -D terminal -i plain game.t3)
I prefer to run the wrapper rlwrap frobd -D terminal -i plain game.t3 so there’s a history of commands.
My goal is of course to at least get the frobd_dap_debugger-branch accepted to the frobtads repository. Having my own fork of frobtads is just temporary. Yet at the same time I believe some of you could benefit from having this.
To build `frobd` one simply follows the normal instructions in the doc/INSTALL document. In mentioned branches the frobd target will by default be built alongside with t3make and (regular) frob.
To use frobd within vscode with vscode-tads3tools, it’s just a matter of opening up the debug panel in vscode while having a project open, click the settings button to create a launch file for tads3 (which points out the location of frobd and the game of to debug) and then start debugging with the green arrow icon.
If no launch file is created it can automatically startup a debug session anyway if frobd is globally accessible. The benefit of having a launch file is that if you have several binaries to choose from within the same folder the launch file pins the particular one you’d like to use every time.
(If trying this out remember to compile the game with the -d flag in order to create debug symbols during compilation, otherwise you are out of luck trying to debug anything.)