11

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?

Eli Barzilay
  • 29,301
  • 3
  • 67
  • 110
Thomas Owens
  • 114,398
  • 98
  • 311
  • 431

2 Answers2

16

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.

dheerosaur
  • 14,736
  • 6
  • 30
  • 31
  • Ah. I was trying to use that, but I think I wasn't using breakpoints properly (or they weren't being set for some reason). I'm managing to set breakpoints where I want them now. I still need to get used to how it works, but I think it might be what I'm looking for. – Thomas Owens Dec 24 '10 at 16:47
2

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.

Eli Barzilay
  • 29,301
  • 3
  • 67
  • 110