[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

More interesting *uninteresting-functions*



I guess I was less than coherent in my first formulation of my question.
I appreciate Scott McKay's response, and I'll attempt to clarify the
difficulty.  I originally wanted to have a condition handler that would
take care of storing the backtrace in a global var and quitting entirely.
It looked something like:

;;;
;;; Store-Backtrace -- when a condition happens, record the backtrace
;;;                    information and throw out.  It's used to protect
;;;                    code like:
;;;    (catch 'panic (condition-bind ((error #'store-backtrace))
;;;                    (code-to-protect)))
;;;
(defun store-backtrace (condition)
  (let ((result nil))
    ;;create the backtrace from where we are now
    (dbg:with-erring-frame (the-frame condition)
      (setf result
            (loop collect
                    ;;the current frame's information
                    (dbg:get-frame-function-and-args the-frame)
                  do
              ;;but only keep interesting frames
              (setf the-frame (dbg:frame-previous-interesting-active-frame
                                the-frame))
                  until
                    (null the-frame))))
    ;;save what we've found, and get outta here
    (setf *panic-backtrace* result)
    (throw 'panic nil)))


This works, BUT it gets all the frames, not just the interesting ones. 
I tried explicitly checking each function's name agains the 
dbg:*uninteresting-functions* list with member, but it seems that that variable
has the right value in the top level (i.e., it works from the lisp listener)
but it is bound to something else during the condition handling.

What am I doing wrong?

While I'm asking this, I have a need for a similar thing that catches all
errors, notifies some other processes that this one has died, and then
(ideally) goes right into the debugger at the error.  I've tried writing
something like the above, and just calling (zl:dbg) to drop into the debugger,
but of course I'm a long way away from the actual crash site.  Is there
a way to have something run at crash time, but then leave things where they
were?

	thanks a lot,
	chris sterritt
	sterritt%sdevax.decnet@ge-crd.arpa