[gambit-list] backtrace fun

lowly coder lowlycoder at huoyanjinjing.com
Sun Jun 21 03:10:25 EDT 2009


~/test$ gsi test.scm -e "(a)"
*** ERROR IN a, "test.scm"@1.23 -- Unbound variable: b
~/test$ gsi test.scm -e "(run)"
#f
#("/home/x/test/test.scm" 1441792)
#("/home/x/test/test.scm" 1048576)
#("/home/x/test/test.scm" 786432)
#f
#((string) 0)
#f
#f
25
~/test$ cat test.scm
(define (a) (pp (+ 20 b)))


(define (run)
  (let ((old-handler (current-exception-handler)))
    (with-exception-handler
      (lambda (e)
    (with-exception-handler
      old-handler
      (lambda ()

        (##continuation-capture
         (lambda (old-cont)
           (do
         ;((cur-frame cont (##continuation-next-frame cur-frame #t)))
         ((cont old-cont (##continuation-next-frame cont #t)))
         ((not cont))
         (pp (##continuation-locat cont)))

           (##continuation-return old-cont 5)))

        )))
      (lambda ()
    (a)))))


Why is it ... that when I print out the continuations by frame, I can't get
the data that I want (which ##cmd-b apparently does get, which is: test.scm,
line 1, character 23).

This baffles me.

(I'm trying to write a gambit debugger in gambit, teehee)

Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://webmail.iro.umontreal.ca/pipermail/gambit-list/attachments/20090621/7e945c18/attachment.html 


More information about the Gambit-list mailing list