How do I step through and debug a Scheme program using Dr. Racket?

Thomas Owens picture Thomas Owens · Dec 24, 2010 · Viewed 7.4k times · Source

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?

Answer

dheerosaur picture dheerosaur · Dec 24, 2010

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.