From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Eric Hanchrow Newsgroups: gmane.lisp.guile.devel Subject: How can I enable tracing in a script? Date: Tue, 25 May 2004 10:35:44 -0700 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <87d64sif4f.fsf@offby1.atm01.sea.blarg.net> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1085513473 15837 80.91.224.253 (25 May 2004 19:31:13 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 25 May 2004 19:31:13 +0000 (UTC) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue May 25 21:31:02 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BShde-0002D1-00 for ; Tue, 25 May 2004 21:31:02 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BShUb-0003MO-FZ for guile-devel@m.gmane.org; Tue, 25 May 2004 15:21:41 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.34) id 1BShU1-0003LR-KB for guile-devel@gnu.org; Tue, 25 May 2004 15:21:05 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.34) id 1BShTV-0003CD-2b for guile-devel@gnu.org; Tue, 25 May 2004 15:21:04 -0400 Original-Received: from [80.91.224.249] (helo=main.gmane.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BSfqA-0000uB-9X for guile-devel@gnu.org; Tue, 25 May 2004 13:35:50 -0400 Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1BSfq7-0000xD-00 for ; Tue, 25 May 2004 19:35:47 +0200 Original-Received: from offby1.atm01.sea.blarg.net ([206.124.138.125]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 25 May 2004 19:35:47 +0200 Original-Received: from offby1 by offby1.atm01.sea.blarg.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 25 May 2004 19:35:47 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: guile-devel@gnu.org Original-Lines: 57 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: offby1.atm01.sea.blarg.net User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3.50 (gnu/linux) Cancel-Lock: sha1:wqPNGmCSm+wrLb2ZHd0gNDfrWK0= X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:3758 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:3758 (recent CVS guile) When I run the following script, I want to see something like [something 3] | [something 2] | | [something 1] | | | [something 0] | | | 0 | | 1 | 3 6 which is what I see when I use the REPL to define `something', and invoke it. But I don't. Am I misunderstanding something? (Note that I don't really believe all the cruft in this script is necessary; I was merely throwing in everything I could think of to get tracing to work) #!/usr/local/bin/guile \ --debug -e main !# (use-modules (ice-9 debug)) (debug-enable 'trace) (trace-stack #t) (debug-enable 'backtrace) (format #t "~s~%" (debug-options)) (format #t "~s~%" (traps)) (format #t "~s~%" (evaluator-traps-interface)) (format #t "~s~%" (list (@@(ice-9 debug) trace-exit) (@@(ice-9 debug) trace-entry))) (evaluator-traps-interface `( exit-frame-handler ,(@@(ice-9 debug) trace-exit ))) (evaluator-traps-interface `(apply-frame-handler ,(@@(ice-9 debug) trace-entry))) (format #t "~s~%" (evaluator-traps-interface)) (format (current-error-port) "This message appears on the current error port.~%") (format #t "traced-stack-ids: ~s~%" (@@(ice-9 debug) traced-stack-ids)) (format #t "trace-all-stacks? ~s~%" (@@(ice-9 debug) trace-all-stacks?)) (define (something arg) (if (not (positive? arg)) 0 (+ arg (something (- arg 1))))) (define (main . args) (trace something) (something (string->number (list-ref (car args) 1)))) ;(something 9) -- But users will not now with glad cries glom on to a language that gives them no more than what Scheme or Pascal gave them. -- Guy Steele, http://www.sun.com/research/jtech/pubs/98-oopsla-growing.ps _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel