Running Execution “Backwards”

No… We can’t actually run your program backwards, but if you want to see where you’ve been, we’ve got a new and easier way of doing that. We can actually make it look like your program is running backwards!

As you conduct your debugging session, all of the commands you’ve issued and all of the reports they’ve produced are retained in the Scroll Area. So you can review this history, both what you’ve done and where you’ve been, simply by using the UP and DOWN scrolling commands (particularly with the C operand).

But until now, there has been no easy way to tease out the where you’ve been displays from all the what you’ve done information in the debug session’s history. Well, now there is…

Here’s What it Does

The UP and DOWN scrolling commands have a new operand, TRACE (or T for short):

  • UP T moves the Scroll Area upwards to position it to the display (usually a WHERE display) produced first after the next prior time z/XDC received control from the program being debugged.
  • Likewise, DOWN T moves the Scroll Area downwards to position it to the display produced first after the next following time z/XDC received control from the program being debugged.

Here’s How to Use It

After you have stepped through your code for a bit, the Scroll Area will have accumulated a number of WHERE displays showing where, in your code, execution has stopped “this time”.

  • If you type a T on the command line and then press the PAGE UP key, this will scroll you back up to the first prior such display.
  • If you do this repeatedly, it will be as if you were watching an animated movie of your program running backwards.
  • Similarly, if you type T and press PAGE DOWN your program will appear to be running forward again.

What About the Registers?

Well, another update (DBC-1811C) has implemented something we’re calling Latent Commands that can be used to save register information into the Scroll Area. Normally, that information remains hidden, but if you issue SET LOG LATENT=SHOW, it will show up. See the blog entry named Something NEW! “Latent Commands” for more information.

Why I Love This!

Sometimes when I’ve been stepping through a lot of code, I can get a bit sleepy and not be paying as close attention as I should to what’s going on.

But suddenly, I’ll have one of those Huh????, what just happened?! moments. How on Earth get I get here! That’s when you’re gonna love UP T.

The update that implements this is named DBC-1807A. The starting point for more information is HELP WHATSNEW Z22 THINGSFIXED MAINTENANCE.