/debug_adapter

Debug Adapter Protocol (DAP) implementation for SWI-Prolog

Primary LanguageProlog

Debug Adapter Protocol for SWI-Prolog

This repository hosts the development of DAP for SWI-Prolog, written in Prolog.

Installation

Make sure you have SWI-Prolog (the swipl executable) installed, and run the following commands in the root of this repository to build the DAP server at bin/debug_adapter:

$ make
$ make check

If you're using GNU Emacs, load elisp/dap-swi-prolog.el and add the following lines to your init.el:

(require 'dap-swi-prolog)

Now run M-x dap-debug in a Prolog buffer and have fun.

Status

Work in progress, see Roadmap

Roadmap

The two big milestones for this project are:

  • Reaching feature parity with SWI-Prolog's built-in graphical debugger with a DAP enabled IDE (GNU Emacs + dap-mode in particular), and
  • Supporting the entire DAP specification

Some of the needed steps towards these goals are:

  • Stepping through the source code of a debugee with precise source positions
  • Stepping over, backwards, etc.
  • Providing source code for dynamic predicates through decompilation
  • Installing breakpoints at source positions
  • Providing information about variable bindings in each frame
  • Editing and reloading source code during break
  • ...

Demo

stepIn Demo