Emacs client/library for Debug Adapter Protocol is a wire protocol for communication between client and Debug Server. It’s similar to the LSP but provides integration with debug server.
The API considered unstable until 1.0 release is out. It is tested against Java, Python, Ruby, Elixir and LLDB (C/C++/Objective-C/Swift).
There are several ways to install dap-mode
.
To use the native Emacs package manager, package.el
, first add
MELPA or MELPA Stable to the package-archive
alist:
(require 'package)
(add-to-list 'package-archives
'("melpa-stable" . "https://stable.melpa.org/packages/"))
Next,
M-x package-refresh-contents
to refresh the package listingM-x package-install RET dap-mode RET
to installdap-mode
Finally, load Emacs Lisp packages and enable dap-mode
:
(package-initialize)
(dap-mode 1)
For users of use-package
, install and enable dap-mode
with:
(use-package dap-mode
:ensure t
:init
(dap-mode 1))
The main entry points are dap-debug
and dap-debug-edit-template
. The first
one asks for a registered debug template and starts the configuration using
the default values for that particular configuration. The latter creates a
debug template which could be customized before running.
dap-debug-edit-template
will prepare a template deceleration inside a
temporary buffer. You should execute this code using C-M-x
for the changes to
apply. You should also copy this code into your Emacs configuration if you wish to
make it persistent.
dap-mode also provides a hydra with dap-hydra
. You can automatically trigger
the hydra when the program hits a breakpoint by using the following code.
(add-hook 'dap-stopped-hook
(lambda (arg) (call-interactively #'dap-hydra)))
- Daniel Martin - LLDB integration.
- Kien Nguyen - NodeJS debugger, Edge debuggers, automatic extension installation.
- Aya Igarashi - Go debugger integration.
- Nikita Bloshchanevich - launch.json support (+ variable expansion), debugpy support, (with some groundwork by yyoncho) runInTerminal support, various bug fixes.