Hey all,
Taking inspiration from some of the discussions in this Discourse group about the built-in IDE of SWI-Prolog in comparison to GNU Emacs and other editors, I’ve decided to take a shot at implementing a Debug Adapter Protocol server for SWI-Prolog with the hopes of bringing the built-in graphical tracer’s strengths into my usual Emacs based workflow.
A very partial implementation can be found here, it’s far from ready but I feel the structure of the server is pretty much in place, so I figured I’d better share it already to get some pointers from the gurus.
One thing in particular that I was wondering is how I can have the server notified whenever a debugged thread spawns a new thread, this could be useful for implementing DAP’s Thread event.
Is there a way to hook thread_create/2
perhaps?
Anyhow here’s a quick demo session using GNU Emacs with dap-mode
stepping through a simple program:
Check out dap-swi-prolog.el for the dap-mode
extension.
Cheers