|
From: <don...@is...> - 2010-11-02 20:02:34
|
Vladimir Tzankov writes: > > Otherwise (return from exemption-wait and no test or loop), it's as > > if exemption-wait returned (whatever value I chose). > Hmm, how are you going to return from exemption-wait from interrupt > function? The only way to get out of it is to perform non-local > exit. I had in mind using the debugger to do something like return or redo. I agree that these are all non-local exits. > > few functions on the stack and then resume? > (thread-interrupt some-thread :function (lambda () (show-stack 1 10))) > second argument of show-stack is number of frames to be shown. [A little off topic, but Is this documented? I don't see it in impnotes. I notice that a version of impnotes all in one page would be useful for searching. ] I do this (loop for x in (mt:LIST-THREADS) do (format t "-- ~a --~&" x) (mt:thread-interrupt x :function (lambda () (ext:show-stack 1 3)))) and I see a backtrace only for the current thread. I see the output of the format for other threads but no backtrace. I do see the backtrace for another thread in its listener. It appears that there's no stream argument. I guess now (after losing contact with all threads) that I should have done something like (loop for x in (mt:LIST-THREADS) do (format t "-- ~a --~&" x) (mt:thread-interrupt x :function (lambda () (let ((*debug-io* *dbg*))(ext:show-stack 1 3))))) where *dbg* is the value of *debug-io* in the debugging thread. A related topic that we may have discussed before: There are situations where you get into an unwind-protect loop and need a way to escape. So far I don't know to do this. Perhaps there is some way already? I'm thinking that a debugger command that does a return from the current frame and then breaks at the place where the return returns to would be useful. |