New Tracing command - T BNC

There's a new TRACE command in town. It's called T BNC ("Branch-No-Call" trace). It works just like T BY except that it steps over subroutine calls! Specifically:

  • It follows your program's execution looking for branching instructions that will actually branch.
  • When execution reaches a linkage instruction (BAS, BAL, JAS, etc.),
  • And that instruction is being used to call a subroutine with return expected,
  • Then execution will not be followed into the subroutine.
  • Instead, recapture traps will be set at the return addresses,
  • And the subroutine will be allowed to run without being followed.

The major benefit of this change is that it makes it considerably more viable than previously to use conditional tracing!

There are several caveats. The most significant one is that T BNC has to distinguish between two major uses of linkage instructions:

  • Call-with-return: Execution jumps to a subroutine, and the subroutine returns using the link address set by the linkage instruction.
  • Point-and-jump-over: Execution jumps over an inline list or parameters, the link register points to that list, and no "return" will ever occur. In this case, T BNC must handle the linkage instruction like any other non-calling, branching instruction.

The trick, of course, is to reliably distinguishing the two cases. That is best done when the code being traced through has been mapped.

One of the use cases for T BNC is for developing a report of the instructions reached by execution within a routine or subroutine. If you use T BNC with a countdown condition (or with any other conditional expression), z/XDC will follow your program's execution until the given condition is met. z/XDC does this by creating recapture traps as your program executes. Then every time a recapture trap is reached, circumstances are evaluated, and if no criteria is met, a new recapture trap is placed, and your program is silently resumed.

But in addition, a trace entry is added to a Branch History Table! Later, you can use a LIST BRANCHES command to see where  execution has gone. You can also capture the table and feed it into whatever analysis tool you may happen to have.

T BNC is published as part of the DBC-2206C update. Once installed, you can read all the gory details at:

  • HELP MAINTENANCE 2022 2206C-T-BNC
  • HELP COMMANDS TRACE BNC
  • HELP BREAKPOINTS TRACING
  • HELP BREAKPOINTS TRACING CONDITIONAL

You may also want to take a look at:

  • HELP MAINTENANCE 2022 2206C-LIST-BRANCHES
  • HELP COMMANDS LIST BRANCHES
  • HELP BREAKPOINTS TRACING CONDITIONAL
  • HELP COMMANDS SYNTAX BREAKPOINTS CONDITIONS COUNTDOWN

The DBC-2206C update contains a LOT more than just the new T BNC command. If you want to read about the top ten, check out HELP MAINTENANCE 2022.

Finally, I have made a lot of changes across the Built-in Help. So I have created and posted new PDFs at colesoft.com/support/documentation/zxdc-release-z22.

Enjoy!