* Tobias C. Rittweiler [2009-07-23 19:10+0200] writes:
Yeah true, but it seems that Java additionally provides a rather complete Debugger API which includes an ExceptionEvent that is invoked at the place an exception is thrown, and where you can get at StackFrame objects.
Yes, I know, but Clojure's Swank doesn't use JDI. And of course, cloning the stack on every throw would be slow; too slow for production use.
[At the point of throw, JDI cannot decide whether the exception will be handled - for JDI try-finally is the same as try-catch - so it's necessary to let throw continue to see who is going to handle the exception. Despite that, the idiom: try {..} catch (Throwable e) {..} is not exactly uncommon in Java. The StackFrame mirror becomes useless after unwinding the real stack, so it would be necessary to copy the backtrace before unwinding.]
JDI more or less assumes that the debugger sets breakpoints before the error occurs. Ironically, Slime doesn't even support breakpoints (despite BREAK).
Helmut