How do I step through and debug a Scheme program using Dr. Racket?
I'm using the Dr. Racket development environment and the language definition #lang scheme
to do work for a course. However, I'm not sure 开发者_高级运维how to best use this tool for debugging. I would like to be able to execute a function and step through it, observing the values of different functions at various points in execution.
Is this possible? If not, what is the typical method of stepping through the execution of a Scheme program and debugging it?
DrRacket includes a graphical debugging interface. Clicking on the Debug button will enable debugging mode. Now, hovering your mouse over any parenthesis will show a pink dot. Right-click on it and a context menu will appear with options to set break-points. Use Go, Step etc.. You can observe the stack and variables in the context in the side-pane.
See docs.
Look in the toolbar -- there is a button labeled "debug" that starts executing the code in debug mode. Once you click it, you can set break points and inspect local variables.
精彩评论