Hi, I have a question about how to kill/stop/terminate the function execution while using slime and clisp?
Thanks in advance.
Surendra Singhi efuzzyone@netscape.net writes:
Hi, I have a question about how to kill/stop/terminate the function execution while using slime and clisp?
`C-c C-b', i.e. slime-interrupt, interrupts the Lisp process. In the REPL buffer it's also bound to C-c C-c. This should then pop up the sldb buffer.
For CLISP, Emacs sends a SIGINT signal to the process. I don't know whether sending SIGINT actually works on Windows, though. Interrupting a multithreaded Lisp works a bit differently: we send a :interrupt message to our "control thread" and the control thread interrupts the "worker" thread.
Helmut.
Helmut Eller e9626484@stud3.tuwien.ac.at writes:
For CLISP, Emacs sends a SIGINT signal to the process. I don't know whether sending SIGINT actually works on Windows, though.
It doesn't work on windows. This is the major show-stopper for me when I just now tried a winxp/emacs/clisp/slime setup. The minor one being the (in practice) non-existing backtrace of frames with compiled functions. The latter I've gathered requires some seriuos clisp hackery, whereas the former I'm hoping I can nudge the good slime developers to fix: What happens is that the slime's PID is nil (that's what the status-line at the top of the emacs frame says), and it's a nil which ends up being sent to (the elisp function) signal-process, and which causes emacs to signal an error. I'd really appreciate it if this could be fixed. (I'm using CVS slime, btw.)
Otherwise, Slime seems quite nice to me, so thanks!
Cheers,
Frode Vatvedt Fjeld frodef@cs.uit.no writes:
It doesn't work on windows. This is the major show-stopper for me when I just now tried a winxp/emacs/clisp/slime setup. The minor one being the (in practice) non-existing backtrace of frames with compiled functions. The latter I've gathered requires some seriuos clisp hackery, whereas the former I'm hoping I can nudge the good slime developers to fix: What happens is that the slime's PID is nil (that's what the status-line at the top of the emacs frame says), and it's a nil which ends up being sent to (the elisp function) signal-process, and which causes emacs to signal an error. I'd really appreciate it if this could be fixed. (I'm using CVS slime, btw.)
I tried to fix this but I failed.
With the CLISP version from the Cygwin distribution it seems to work ... well, sometimes. The Emacs frame blinks and somehow loses the focus, but the backtrace shows up after a few seconds.
I have only a very oldish Windows 98 and the Lisp-in-a-box package didn't work here. I can only use CLISP's "base" version. The base version has no win32 package and so the pid is always nil. The "full" version complains about a missing function in kernel32.dll when GetCurrentProcessId is called. Does win32::|GetCurrentProcessId| work on WinXP? The Cygwin version uses system::program-id.
I also tried to set the slime-pid manually to the pid of the inferior-process, but the subprocess died when I tried to interrupt it.
Helmut.
Helmut Eller e9626484@stud3.tuwien.ac.at writes:
I have only a very oldish Windows 98 and the Lisp-in-a-box package didn't work here. I can only use CLISP's "base" version. The base version has no win32 package and so the pid is always nil. The "full" version complains about a missing function in kernel32.dll when GetCurrentProcessId is called. Does win32::|GetCurrentProcessId| work on WinXP? The Cygwin version uses system::program-id.
Right, now I changed to the "full" clisp version, and I get a PID also. GetCurrentProcessId works fine. Unfortunately, signal-process (the elisp function) has no effect on clisp. That is, clisp dies immediately upon receiving signals 1 or 9, but completely ignores any other signal.
Would it be possible, as a qick-and-dirty-hack, to poll some interrupt flag in the (swank?) IO stream glue such that clisp can be breaked at least if it emits some output? (Or perhaps even a once-a-second or so timer polling could be implemented?)
Has anyone tried to talk to the clisp people about having a break signal for a proper solution under win32?
Frode Vatvedt Fjeld frodef@cs.uit.no writes:
Would it be possible, as a qick-and-dirty-hack, to poll some interrupt flag in the (swank?) IO stream glue such that clisp can be breaked at least if it emits some output? (Or perhaps even a once-a-second or so timer polling could be implemented?)
Hmm.. the patch below tests whether some input is available after sending something to Emacs. If so the input is processed immediately. So, typing `C-c : (break) RET' should give you a debugger the next time something is sent to Emacs. You also need to add
(setq swank:*use-dedicated-output-stream* nil)
to your ~/.swank.lisp. (Otherwise output is send to an extra stream for efficiency reasons.)
Has anyone tried to talk to the clisp people about having a break signal for a proper solution under win32?
Not that I know of.
Helmut.
Thanks Helmut, your patch seems to work--I'm heistant to say "works well", but it's certainly better than no interrupt at all.