I broke slime

If you use a pre-1.0.8 SBCL with CVS SLIME, it won't work.

When I'm trying to debug functions, I often add (declare (optimize (debug 3))) to the top and then use "v" in sldb to jump directly to the location of the error in the source. Then I take out the declare bit after I'm done troubleshooting.

To automate this, I added an option to compilation that uses the new experimental SB-EXT:RESTRICT-COMPILER-POLICY function to compile with maximum debug. That is, C-u C-c C-c will recompile individual forms at debug 3. You don't have to manually add and remove it, and you don't have to run your whole system with elevated debug.

It only works on SBCL 1.0.8 and newer, though. I think it'd be handy for all backends, but I don't know how to add it.

Tags:

Comments

(Anonymous)

Locally?

Could you make a general solution that evaluates the region/function/expression from slime in a locally block? something like: `(locally (declare (optimize (debug 3))) ,@body). Sure that wouldn't override any function that have explicit declarations in it the way SB-EXT:RESTRICT-COMPILER-POLICY does but would probably be a good baseline.

Nathan Bird

Re: Locally?

For SBCL, I think, that screws up the source location recording. It might work fine for other Lisps.

September 2014

S M T W T F S
 123456
78910111213
14151617181920
21222324252627
282930    
Powered by LiveJournal.com