[slime-devel] Re: How to debug a crash?
Harald Hanche-Olsen
hanche at math.ntnu.no
Thu Dec 7 21:14:06 UTC 2006
+ Helmut Eller <heller at common-lisp.net>:
| * Harald Hanche-Olsen [2006-12-03 23:05+0100] writes:
|
| > Is there an easy way to get a trace of the traffic between emacs and
| > the superior lisp? I know that some such information is traced on the
| > emacs side, but since emacs crashes, I cannot see it there.
|
| You can set swank:*log-events*
Ah. Obvious once you know what to look for. 8-) Thanks.
| > One more thing. I guess I should have asked this very basic question
| > first: Does the mere fact of editing a Lisp file cause communication
| > with the swank server? If so, what is being communicated?
|
| Yes, Emacs notifies the Lisp side on the first buffer change.
And not only that, but it gets the entire contents of the file back,
which seems like a waste of bandwidth, given that slime doesn't appear
to use the return value for anything.
The following patchlet simplifies the return value to nil or t, and
incidentally stops my crashes from happening (however, the crashes are
most likely a symptom of a deeper problem that I still don't know how
to debug).
diff -u -8 -r1.6 swank-source-file-cache.lisp
--- swank-source-file-cache.lisp 26 Nov 2006 18:08:30 -0000 1.6
+++ swank-source-file-cache.lisp 7 Dec 2006 21:07:35 -0000
@@ -39,17 +39,18 @@
text date)
(defimplementation buffer-first-change (filename)
"Load a file into the cache when the user modifies its buffer.
This is a win if the user then saves the file and tries to M-. into it."
(unless (or (source-cached-p filename)
(not (ignore-errors (probe-file filename))))
(ignore-errors
- (source-cache-get filename (file-write-date filename)))))
+ (source-cache-get filename (file-write-date filename)))
+ t))
(defun get-source-code (filename code-date)
"Return the source code for FILENAME as written on DATE in a string.
If the exact version cannot be found then return the current one from disk."
(or (source-cache-get filename code-date)
(read-file filename)))
(defun source-cache-get (filename date)
- Harald
More information about the slime-devel
mailing list