i'm in the process of porting the new backend to openmcl and i've managed to get emacs to block every single time i try to connect to slime. so far i've localized the problem to something inside slime-init-connection, but since emacs is blocked i can't get any debugging info (like the contents of stlime-events or access to inferior-lisp). whats the best way to go about debugging lime?
-- Marco Ring the bells that still can ring. Forget the perfect offering. There is a crack in everything. That's how the light gets in. -Leonard Cohen
Marco Baringer mb@bese.it writes:
i'm in the process of porting the new backend to openmcl and i've managed to get emacs to block every single time i try to connect to slime. so far i've localized the problem to something inside slime-init-connection, but since emacs is blocked i can't get any debugging info (like the contents of stlime-events or access to inferior-lisp). whats the best way to go about debugging lime?
Locked to the point where holding down C-g won't get you out? Yuck.
This is probably easiest to debug from the Lisp side. You can fire up Lisp in a terminal and run:
(load "/home/path/swank-loader") (swank:start-server "/tmp/port.txt")
Then it will write the server port number to /tmp/port.txt. Now from Emacs you can use `M-x slime-connect' for a manual connection.
Hopefully that's some help?
You might also want to set swank::*use-dedicated-output-stream* to NIL. That is an optional optimization that uses an extra socket, and by disabling it the server won't call accept-socket/stream. It might be easier to start with.
-Luke
Marco Baringer mb@bese.it writes:
i'm in the process of porting the new backend to openmcl and i've managed to get emacs to block every single time i try to connect to slime. so far i've localized the problem to something inside slime-init-connection, but since emacs is blocked i can't get any debugging info (like the contents of stlime-events or access to inferior-lisp). whats the best way to go about debugging lime?
It's probably the slime-eval call for getpid. It's strange that your Emacs is blocked. When I press C-g at that location I get in the debugger.
To unlock Emacs, I use sometimes 'gdb attach <emacs-pid>' and then 'call Ftoplevel ()'. 'call Frecursive_edit ()' might also work. It's better not to call these functions during a GC :-), but it seems to work fine at blocking calls to select or gettimeofday. Of course, you need an Emacs with enough debugging info for this approach.
Debugging the Lisp side is easier if you set *log-events* to t and *redirect-output* to nil.
Helmut.