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

Invoking the debugger in a meaningful frame



For those that care, here's the answer to my previous
question.  Apparently there is no documentation
on (declare (dbg:error-reporter)), ya just gotta know.
Now you do.


Date: Tue, 23 Feb 1993 15:47 EST
From: Scott McKay <SWM@STONY-BROOK.SCRC.Symbolics.COM>
Subject: Invoking the debugger in a meaningful frame
To: Healy@space50.nrl.navy.mil
In-Reply-To: <19930223194151.8.HEALY@space20.nrl.navy.mil>

    Date: Tue, 23 Feb 1993 14:41 EST
    From: Liam M. Healy <Healy@space50.nrl.navy.mil>


    How do I signal an error and end up in a meaningful frame
    of the debugger, skipping internal condition stuff like :internal
    functions and cli::compatible-restart-trampoline?
    For example, (check-number -3)

Try including the code in uppercase

    (defun check-number (number)
-->   (DECLARE (DBG:ERROR-REPORTER))      
      (if (minusp number)
	  (conditions:restart-case
	    (conditions:error "The number is negative")
	    (this
	      ()
	      :report "Leave it")
	    (that
	      ()
	      :report "Change sign"
	      (setf number (- number)))
	    (abort
	      ()
	      :report "Abort"
	      (return-from check-number nil))))
      number)


Liam Healy