Factor Language Blog

Single stepping

Sunday, October 1, 2006

With a stack language, single stepping has a certain intuitive appeal, and there is no ambiguity when it comes to what will happen next. Single stepping through C, on the other hand, is an exercise in frustration. Suppose you have a piece of code like:
foo(bar(),baz())
If I want to step over the calls to bar() and baz(), but step into foo(), it appears that I’m out of luck, at least in gdb. You can set a breakpoint on foo(), or just step into the nested function calls and then step out, but it wastes time and breaks concentration.
I like having a programmer-visible stack. It seems to shorten the ‘round trip time’ between my brain and the computer.