[slime-devel] Re: Crash course in SLIME RPC debugging (Re: SLDB hangs with CLISP/Cygwin)

Steven E. Harris seh at panix.com
Mon Mar 14 21:49:57 UTC 2005


Luke Gorrie <luke at synap.se> writes:

> I'm tempted to accuse your Emacs of having a broken throw/catch, but
> that's dangerous talk.

Forget my previous message.

I found the problem, or at least I found a remedy that makes the
problem go away. In slime-process-available-input, there's an extra
attempt to read each buffer associated with slime-net-processes after
the first set of events have been dispatched. If some input is
available in these buffers, a follow-on call to
slime-process-available-input gets scheduled.


,----[ slime-process-available-input ]
|     (dolist (p slime-net-processes)
|       (with-current-buffer (process-buffer p)
|         (when (slime-net-have-input-p)
|           (run-at-time 0 nil 'slime-process-available-input))))
`----

If I comment out this second attempt at reading, XEmacs no longer
hangs. Putting some instrumentation in slime-process-available-input
showed that slime-net-have-input always returns true (at least after
reading the result of a frame-locals query per my example), indicating
there's another event ready for reading.

If I replace the above form by:

,----[ slime-process-available-input (modified) ]
|     (dolist (p slime-net-processes)
|       (with-current-buffer (process-buffer p)
|         (when (slime-net-have-input-p)
|           (message "s-p-a-i: more available in process %s: %s." p
|                    (slime-net-decode-length))
| ;          (run-at-time 0 nil 'slime-process-available-input)
|           )))
`----

I see the following log message after each "throw" in slime-eval:

,----
| s-p-a-i: more available in process SLIME Lisp: 22.
`----

The 22 count would match events like this:

,----[ *slime-events* sample ]
| (:debug-activate 0 2)
`----

that appear in *slime-events* after each local listing. Here are the
events produced by hitting enter on a frame in SLDB:

,----[ *slime-events* sample ]
| (:emacs-rex
|  (swank:frame-locals-for-emacs 1)
|  nil 0 86)
| (:debug-activate 0 2)
| (:return
|  (:ok
|   ((:name "N" :id 0 :value "1")))
|  86)
| (:emacs-rex
|  (swank:frame-catch-tags-for-emacs 1)
|  nil 0 87)
| (:debug-activate 0 2)
| (:return
|  (:ok nil)
|  87)
`----

The corresponding messages in *Message Log* are:

,----
| s-p-a-i: have input in process SLIME Lisp.
| s-p-a-i: have input in process SLIME Lisp.
| Throwing result nil to tag slime-result-48471
| s-p-a-i: more available in process SLIME Lisp: 22.
| Caught slime-result-48471
`----

Perhaps there's no appropriate handler for these "debug-activate"
events. Please let me know if you need more information to help
further diagnose the problem.

-- 
Steven E. Harris




More information about the slime-devel mailing list