Newsgroups: comp.lang.lisp
Path: cantaloupe.srv.cs.cmu.edu!europa.chnt.gtegsc.com!news.mathworks.com!newshost.marcam.com!usc!cs.utexas.edu!swrinde!emory!nntp.msstate.edu!terminator.ncts.navy.mil!info.usuhs.mil!apgea.army.mil.!admii!lhc!lhc!mabramso
From: mabramso@play.nlm.nih.gov (Myriam Abramson)
Subject: automatic backtrace
Message-ID: <MABRAMSO.95Jul5160311@play.nlm.nih.gov>
Followup-To: comp.lang.lisp
Sender: news@nlm.nih.gov
Organization: National Library of Medicine
Date: 05 Jul 1995 20:03:11 GMT
Lines: 51



I am running lisp in the background and I would like (actually, I am quite desperate)
to turn on backtrace in case of an error.

I am using CMUCL, but I don't think the implementation matters.  

What I did below doesn't give me the correct backtrace but might be helpful to
understand what I would like to accomplish.

Thanks,


;;;cmucl -load thisfilename > thisfilename.out &
(setf *terminal-io* (make-two-way-stream (make-concatenated-stream)
					    (make-broadcast-stream)))


(setf *debug-io* *standard-output*)


(defun test1 (x)
  (test2 x))

(defun test2 (x)

  (test3 x))

(defun test3 (x)
  (ecase x
    (1 "test")
    (2 "test")
    (3 "test")))

(handler-case (test1 4)
  (error (condition)
     (format t "~%~A" condition)
      (debug:backtrace)
     (quit)))

(quit)







--

                                          myriam
