Debugger improvements in Cider 0.10.013 Jul 2015, by Artur Malabarba.
Over the last couple of weeks I had a few more days to work on the Cider
debugger, and it’s getting a slew of improvements on the next release
0.10.0). This starts with a complete rewrite, so it now supports almost
everything, and ends with some small features and UI improvements. Without
further delay, here’s a video.
There’s a lot going on in there, so let’s start dissecting.
- Maps are now supported. This may sound trivial, but the previous version couldn’t debug inside maps (it’s trickier than it seems).
- More specifically, prepost-maps are supported! If this sounds sweet, that’s because it is.
- Even some code-rewriting stuff is supported, like the beloved threading macros.
- Function literals are also supported.
- The n, c, i, and q keys were already available in the previous version, so I’ll just link you to the previous post on them.
- The o key, showcased halfway through the video, moves you *o*ut of a sexp,
without moving back in. It’s useful in
whileloops and in
- The l key presents an inspector buffer detailing local variables.
- Unlike in the previous version, you are allowed to move around and do other stuff while the debugger waits for input. You can even evaluate stuff in the current lexical environment with e or the usual C-x C-e.
- In addition to the command used the video (which simply debugs an entire
function) you can also debug specific forms with
#dbg, and you can place a single breakpoint anywhere with
#break. If you use one of these, just evaluate the form with your usual evaluation commands (like C-x C-e or C-c C-c) and you’re good to go.
- Functions which are currently instrumented are marked with a red box around the name.
- You can list all instrumented functions with M-x
The next planned step for the debugger is ClojureScript support, but that’s
likely going to take a while. In the meantime, why not try the Cider
snapshots and help us find any bugs?