[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-hackers] debugging chicken itself
From: |
Mario Domenech Goulart |
Subject: |
Re: [Chicken-hackers] debugging chicken itself |
Date: |
20 Feb 2007 17:54:42 -0300 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 |
Hi Brandon,
On Tue, 20 Feb 2007 12:34:30 -0800 "Brandon J. Van Every" <address@hidden>
wrote:
> Is there a way to trace Chicken's execution of Scheme code? I'd like
> to see the Scheme code actually executing, even if it is slow. I'm
> trying to figure out if I can improve Chicken's generation of C code
> for 32-bit floating point math functions. I find that the sources
> really don't make any sense to me. If I could see them working, then
> maybe I'd have an idea what's going on, what the flow of control is.
I guess it's not exactly what you are looking for, but maybe it's
worth mentioning some REPL features:
csi> ,?
Toplevel commands:
,? Show this text
,p EXP Pretty print evaluated expression EXP
,d EXP Describe result of evaluated expression EXP
,du EXP Dump data of expression EXP
,dur EXP N Dump range
,q Quit interpreter
,l FILENAME ... Load file with given filename
,ln FILENAME ... Load file and print result of each top-level expression
,r Show system information
,s TEXT ... Execute shell-command
,tr NAME ... Trace procedures
,utr NAME ... Untrace procedures
,br NAME ... Set breakpoints
,ubr NAME ... Remove breakpoints
,breakall Break in all threads
,breakonly THREAD Break only in specified thread
,c Continue from breakpoint
,info List traced procedures and breakpoints
,step EXPR Execute EXPR in single-stepping mode
,exn Describe last exception
,t EXP Evaluate form and print elapsed time
,x EXP Pretty print macroexpanded expression EXP
csi> (define (factorial n) (if (< n 2) 1 (* n (factorial (sub1 n)))))
csi> ,tr factorial
csi> (factorial 6)
|(factorial 6)
| (factorial 5)
| (factorial 4)
| (factorial 3)
| (factorial 2)
| (factorial 1)
| factorial -> 1
| factorial -> 2
| factorial -> 6
| factorial -> 24
| factorial -> 120
|factorial -> 720
720
Maybe you can use ,tr to trace the specific procedures you want to
observ.
> Failing that, anyone recommend other ways to visualize the code? In
> the MSVC universe there are typically class browsers, so you can see
> what code belongs to what. I suppose a call graph generator would be
> helpful; this is typical of profiling tools.
Well, there are some class browsers for Emacs (e.g.,
http://ecb.sourceforge.net/), but I don't know if they may be useful.
Best wishes,
Mario