Dap Mode

How To Python

  • Ensure debugpy is installed (pip install debugpy) in the virtual environment. I install this by default in new virtual environments (see: .pyenv/defaultpackages).

In source file, move point somewhere you want a breakpoint, and run M-x dap-breakpoint-toggle

Go to test file, move point to a test. Run dap-debug. Select option to run the pytest test at point.

Jumping in the Stack

You can jump forward or backward in the stack. Use M-x dap-switch-stack-frame, or click around in the "Debug Sessions" dap buffer.

TODO: How does this work? Does this only work in languages with first-class continuations? How much program state is actually restored?

  • dap-disconnect Quit the debugging session

Old Sessions

Saves output from old debug sessions

Delete them in the dap-ui-sessions buffer, D