frobd - frobtads debugger

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.)

5 Likes

Yet another reason for me to wish I could build Frobtads on Windows. The standard version works on WSL, but it would be much nicer to have access to it natively, especially since the standard TADS debugger isn’t the greatest with screen readers.

That’s too bad. I thought you could build frobtads on wsl too? I tried recently but I believe I failed by not being able to find the ncurses and curl libraries needed. Not sure I recall this correctly though. Will have another go with this some time soon.

I can build it just fine in WSL, but I would prefer native Windows personally. As for packages, in Debian distributions, libcurl4-gnutls-dev and libncurses-dev should do the job, along with cmake, GCC and all the rest.

Actually, now that I come to think about it, it was the native version I tried to build, not via wsl. It’s good to know that it was a dead end.

Maybe there’s a better interpreter out there to host the debugger code. It should be fairly easy to port it since it isn’t tied to ncurses or anything. I’m thinking since I can’t get hold of the maintainer of frobtads anyway.

Tadsrunner perhaps