[Ecls-list] Any way to get stack out of condition?
Peter Enerccio
enerccio at gmail.com
Wed Jan 30 16:06:47 UTC 2013
Well, I am trying to get with handler-bind, however, it still prints
nothing at all (for the backtrace, I mean)
(defun handle-any-error-log (e)
(print "x") ; checking that we are indeed in the handler
(with-open-file (eout "errors.txt"
:direction :output)
(format eout "Unhandled error detected: ~%")
(format eout "~A~%" e)
(format eout "Backtrace: ~%")
(loop for x from (si::ihs-top)
to 0 do
(format eout "~A~%" (si::ihs-fun x)))
(format eout "~%")))
(eval-when (:load-toplevel :execute)
(handler-bind
((error #'handle-any-error-log))
(post-initialization)))
Output:
enerccio at G73Jh-Arch:~/projects/gaia/gaia$ cat errors.txt
Unhandled error detected:
LOAD: Could not load file
#P"/media/home/home/enerccio/projects/gaia/gaia/plugins/crap.fas" (Error:
"/media/home/home/enerccio/projects/gaia/gaia/plugins/crap.fas: file too
short")
Backtrace:
NIL
2013/1/30 Anton Vodonosov <avodonosov at yandex.ru>
> In CL you usually can't get stack trace "out of condition".
>
> Usually you can get the current stack trace. I.e. before stack is unwound.
> I.e. catching error handler-bind you can get stack trace, because you are
> still
> inside the stack, but for example with handler-case you are invoked after
> the stack is unwound.
>
> PS. also check out trivial-backtrace if you want be portable library,
> although
> I don't know if it supports ECL.
>
> 30.01.2013, 19:49, "Peter Enerccio" <enerccio at gmail.com>:
> > I tried looking it up there, however it uses si::ihs-top/si::ihs-fun,
> which at the condition handlers are for some reason 0 so there is nothing
> to do at that point.
> >
> > 2013/1/30 Stas Boukarev <stassats at gmail.com>
> >> Peter Enerccio <enerccio at gmail.com> writes:
> >>
> >>> Hello, I was wondering if it is possible to get the stack of thrown
> >>> condition.
> >>> I dont think there is ansi way of doing that, however, I can see stack
> >>> generated by conditions thrown in slime with ecl, so there must be a
> way to
> >>> do it.
> >> You can look at swank-ecl.lisp to see how slime does it.
> >>
> >> --
> >> With best regards, Stas.
> >
> > --
> > Bc. Peter Vaňušanik
> > http://www.bishojo.tk
> > ,
> >
> ------------------------------------------------------------------------------
> > Everyone hates slow websites. So do we.
> > Make your web apps faster with AppDynamics
> > Download AppDynamics Lite for free today:
> > http://p.sf.net/sfu/appdyn_d2d_jan
> > ,
> > _______________________________________________
> > Ecls-list mailing list
> > Ecls-list at lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/ecls-list
>
--
Bc. Peter Vaňušanik
http://www.bishojo.tk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20130130/2cfbb3f3/attachment.html>
More information about the ecl-devel
mailing list