[OS X Emacs] Slime+OpenMCL: debugging

Bill Clementson billclem at gmail.com
Fri Dec 12 02:02:00 EST 2008


On Thu, Dec 11, 2008 at 10:03 PM, David Reitter <david.reitter at gmail.com> wrote:
> On 11 Dec 2008, at 21:30, Bill Clementson wrote:
>>
>> "C-h m" or "C-h b" in the SLDB buffer will show you the available
>> SLIME debugger key bindings.
>
>
>
>> Hmm, looks like it should be (debug 3) instead.
>>
>>> How would I declare something for a file?
>>
>> At the top of the file use "declaim":
>> (declaim (optimize (debug 3)))
>>
>> Note that CCL may optimize code such that the actual line isn't shown
>> but it should get you to the right function.
>
> No dice.  I even tried this:
>
> (declaim (optimize (speed 0) (space 0) (debug 3)))
>
> I still only get to l1-boot-3.lisp.
>
> Any other suggestions, perhaps were to look?  (I will build the
> documentation now.)
>
> That's with SLIME CVS btw.

Hmm, that's odd. I haven't used CCL for a while now (I'm mostly using
SBCL and Clojure at the moment); however, I do have a not-too-old copy
of CCL on my Mac (dated 2008-09-18). My SLIME is 2008-12-02. I created
a simple file, test.lisp:

(declaim (optimize (debug 3)))

(defun x (y z)
  (+ y z)
  (/ y z))

I do C-x C-s to save it and then do C-c C-k to compile the buffer. I
then switch to the repl and I enter (x 3 0) and get an SLDB debugger
buffer:

DIVISION-BY-ZERO detected
   [Condition of type DIVISION-BY-ZERO]

Restarts:
 0: [RETRY] Retry SLIME REPL evaluation request.
 1: [ABORT] Return to SLIME's top level.
 2: [ABORT-BREAK] Reset this process
 3: [ABORT] Kill this process

Backtrace:
  0: (CCL::%FIXNUM-TRUNCATE)
  1: (CCL::INTEGER-/-INTEGER 3 0)
  2: (/ 3 0)
  3: (X 3 0)
  4: (CCL::CALL-CHECK-REGS X 3 0)
  5: (SWANK::EVAL-REGION "(x 3 0)\n")

I place the cursor on #4 in the SLDB buffer and press 'v' - it goes to
the beginning of the call-check-regs function. I then place the cursor
on #3 in the SLDB buffer and press 'v' - it goes to the beginning of
the x function.

If you repeat the above steps, does this not work for you?

>> I just use the current CVS SLIME and the latest development version of
>> the CL that I'm working with and rarely have issues.
>
> OK, maybe we'll have to do that in Aquamacs, too, if no-one volunteers to
> make an installable .pkg so it can be updated independently.

I thought John Wiegley was going to do this (based on the earlier
email exchange we had)?

>> But C-c C-t is defined as a key binding in both slime mode and slime
>> repl mode, so why do you think C-c C-t "doesn't work as expected" if
>> it's bound to trace/untrace? You didn't say what buffer you wanted to
>> clear, but I'm assuming it's the REPL buffer. The command there is C-c
>> M-o.
>
> Thanks.   I wish we had a consistent binding for that, e.g., in ESS (R)
> mode, C-c M-o doesn't work.  Not SLIME's fault, but really an omission in
> Emacs (same for indentation functions).
>
>> Have you built the documentation for SLIME? It's actually quite good
>> and very readable. Just do "make" in the slime/doc directory and then
>> you can view the slime.info or slime.pdf files. Don't read the on-line
>> docs (on the SLIME home page) as they are terribly out-of-date.
>
> That's what I looked up when I was looking for the 'v' command.  Didn't
> think the documentation online would be outdated.
> Why don't people update the online documentation (if it is so easy), or take
> it down?

Yeah, it's crazy that the out-of-date stuff is left online (people
have complained in the past; however, the old stuff is still there).
It would be far better to not have any online documentation than to
have out-of-date documentation.

>> Also, you would probably get better answers to slime-related questions
>> on the slime development list:
>> http://common-lisp.net/mailman/listinfo/slime-devel
>
> Yeah, I must say, I was subscribed to this a while ago.
> Recently I submitted a bug report with patch to the bugs mailing list, which
> bounced because I wasn't subscribed (I want to report a bug and its fix
> rather than reading all other people's bug reports or manage yet another
> mailing list subscription).  I sent to Helmut Eller, I hope that was the
> right address (I haven't heard back).

It would be better to submit patches to the developer's list and
follow-up on the list if you don't hear back that someone committed
the patch. There isn't a single "go to" person that handles patches
submitted by developers who don't have commit privileges.

> Thanks for your help, Bill!

You're welcome. And, good luck with slime, it's worth the effort spent
learning to use it if you intend to do any serious CL development work
with emacs.

--
Bill Clementson



More information about the MacOSX-Emacs mailing list