A modern step-debugger for Erlang, that freezes the whole node when a process hits a breakpoint, allowing for the inspection of every process running inside it. It is IDE agnostic and can be used from any IDE that implements the Debugger Adapter Protocol.
It requires OTP 28 or later. For more technical details, see our paper in the Erlang 2025 Workshop.
Important
edb requires new debugging extensions exposed by OTP, so the development of both go hand in hand.
The main branch of edb currently expects some extensions that have not yet been merged. If you
are expecting to use edb on OTP 28.0 or 28.1, please use the otp-28.0 branch of edb instead.
Instructions differ depending on the IDE.
On VSCode you need a debugging extension for Erlang that includes edb. Then see this guide
and the edb DAP guide.
- The Erlang Language Platform extension
provides a prebuilt version of
edband code-lenses to debug Common-Test testcases.
- Build
edbfrom source (see below) - Pick an emacs DAP client, such as dape or dap-mode
- See the
edbDAP guide
- Build
edbfrom source (see below) - Pick a DAP client, such as vimspector or nvim-dap
- See the
edbDAP guide
Before we can debug a rebar3 project with edb, we need to ensure that we build the code using the beam_debug_info and
beam_debug_stack option. The former adds debug symbol information needed to be able display variable names on a paused process; the latter
preserves the values of variables that are no longer live, which is more useful for debugging, but increases the stack usage. In modules
where the increased stack usage is problematic, it can be disabled by adding -compile(no_beam_debug_stack).
Since we want to only use the debugger during development and we don't want to affect production, these changes can be limited to the test profile.
Open the rebar.config file for the project and ensure one of these options is included as part of erl_opts.
{profiles, [
{test, [
{erl_opts, [beam_debug_info, beam_debug_stack]}
]}
]}.
edb requires debugging extensions available since OTP 28.0, and more extensions are in the process of being
added. Because the main branch of edb always assumes that these additional extensions are present, if you
are building from source and targetting OTP 28.0 or 28.1, use the otp-28.0 branch of edb instead.
Moreover, a version of rebar3 built with Erlang/OTP 26 or higher is required. You can find instructions on how to build rebar3
from source here.
For convenience, a patched version of Erlang/OTP is checked in as a git submodule.
You can build and install the modified version of Erlang/OTP by doing:
$ git submodule update --init
$ pushd otp
$ ./configure --prefix $(pwd)/../otp-bin
$ make -j$(nproc)
$ make -j$(nproc) install
$ popd
Note: on Mac you may need to provide a custom installation path for OpenSSl. Just replace the above configuration step with:
$ ./configure --prefix $(pwd)/../otp-bin --with-ssl=$(brew --prefix openssl)
Then simply add the installation dir to your $PATH:
$ export PATH=$(pwd)/otp-bin/bin:$PATH
Verify the Erlang installation:
$ which erl # Should point to the newly built version of Erlang/OTP
$ rebar3 escriptize
The produced edb escript will be available in:
_build/default/bin/edb
When starting edb as a DAP debugger, it logs useful information that can help you understanding whether edb is communicating correctly with a client (tipically, the IDE).
To find the location of the EDB DAP logs on your machine, open an Erlang shell and run:
$ erl
Erlang/OTP [...]
Eshell [...] (press Ctrl+G to abort, type help(). for help)
1> filename:basedir(user_log, "edb").
That will return the path where you will find a edb.log file.
EDB is Apache 2.0 licensed, as found in the LICENSE.md file.
Copyright © Meta Platforms, Inc