Did you know ... Search Documentation:
Pack debug_adapter -- prolog/swipl_debug_adapter.pl
PublicShow source
 swipl_debug_adapter_command_callback(+Command, +Arguments, +ReqSeq, +Handle, +State0, -State) is semidet
True when the SWI-Prolog debug adapter server transitions from State0 to State while handling DAP command Command and arguments Arguments.

This predicate is passed as the on_command callback option of da_server/1.

 swipl_debug_adapter_client_command(+TCPPort, -Client, -Exec, -Args) is multi[multifile]
Multifile predicate, specifies an external command used for starting an interactive DAP client.

By default, swipl_debug_adapter currently defines a single DAP client, which unifies Client with emacs('dap-mode'), Exec with path(emacs) and Args with ['--eval', Elisp] where ELisp is a string denoting an Emacs Lisp form that Emacs executes to start the DAP session.

Users can specify different DAP clients by defining other clauses for this predicate. The solutions of this predicate are collected using findall/3, if mulitple solutions are found when the tracer is started, the user will be prompted to select a client to start.

Note: before version 0.7.0 of the debug_adapter package, a similar feature was provided that relied on a different multifle predicate, user:debugger_connection_template/1. This predicate supersedes that interface which is now obsolete.


  • TCPPort is an integer denoting the local TCP port which the DAP server is listening on and client should connect to.
  • Client should be unified with an arbitrary descriptive term that identifies the client.
  • Exec should be unified with a specification of the client executable.
  • Args should be unified with a list of command line arguments that will be passed to client executable.