Interactive debugging and testing features
When your program is executed under interactive Code Debug TSO, the source is displayed in a fully scrollable window where you can view the inner workings of the program as each statement is executed. For instance, you can see the execution arrow moving from a CALL statement to the actual procedure, or you can see a variable changing its value as the ASSIGN takes place.
The following figure shows the Source display screen under Code Debug TSO. All debugging and testing functions are accessible from this screen without having to exit to a separate screen.
Code Debug TSO does not require any source code or load module changes; however, you need to create a “symbolic” information data set called the source listing file to debug at the source level. The source listing is created by compiling your programs with the BMC AMI Common Shared Services PL/I language processor. Code Debug TSO displays and processes the source listing records during the test session.
PL/I Program in the Source Display Screen
COMMAND ===> SCROLL===> CSR
BEFORE BREAKPOINT ENCOUNTERED
** END **
------ ----------------------------------------- Before TRIMINP1/AMODE 31 <>
=====> B TRIMAINP: PROC OPTIONS(MAIN);
------
000002 DCL INFILE INPUT RECORD FILE;
000003 DCL IN_REC BASED(IN_REC_PTR) CHAR(80);
------ /* */
------ /* */
------ /* DECLARE EXTERNAL ENTRY PROGRAMS */
------ /* */
------ /* */
------
000004 DCL TRITSTP EXTERNAL ENTRY;
000005 DCL TRIRPTP EXTERNAL ENTRY;
000006 DCL ADDR BUILTIN;
------
000007 DCL 1 N_N_C_TABLE,
The capabilities of Code Debug TSO are extensive enough to assist the experienced programmers’ needs, and yet, the implementation is simple enough and efficient enough to curtail the learning curve that novice programmers generally experience. The following list summarizes Code Debug TSO’s major features:
- Intercept program abends.
Code Debug TSO detects application abends and displays a diagnostic message. You can request an Abend-AID formatted report if you have Abend-AID. You can also view the session log for more information. If the problem is a recoverable error, you can fix the error dynamically and resume execution.
- Start or stop execution at any point.
You can set conditional or unconditional breakpoints, so you can stop program execution at any point and figure out what the program has processed so far, and what the consequences of any changes could be. You can also step through code, line by line, to understand how each statement affects the program.
- Display and modify variable, register, and storage contents.
You can view the values of any variable as your program executes, and if you want, alter the values as if the program had actually moved in the value you requested. Arrays can be displayed by dimension, and you can browse through each entry by incrementing and decrementing the subscript. You can also display general-purpose registers and memory to analyze the problem at the lower level.
- Trace logic flow.
Statements can be highlighted to identify the execution path as Code Debug TSO traces through the program. You can control the speed of the execution so that you can follow the logic interactively at a speed that best suits you.
- Monitor execution coverage.
You can set counters on statements to test execution coverage or to monitor loops and procedure calls for optimization.
- Alter logic.
You can dynamically change the control flow by modifying the data values or by forcing a branch to test an alternate path.
- Bypass unwanted code.
You can skip a range of statements or programs.
- Temporarily insert Code Debug TSO debugging statements.
You can insert Code Debug TSO commands to control debugging conditions that occur at a certain location and to force data and logic changes. This feature lets you prototype some PL/I-like constructs. If you have Code Debug for Db2 Extension and File-AID for Db2, you can also insert SQL statements.
- Display file status and DCBs.
VSAM file status and last I/O operation can be retrieved through Code Debug TSO. DCB information can also be checked in the case of I/O error. When a DD statement is not preallocated, Code Debug TSO intercepts execution and gives you an opportunity to allocate the missing files before resuming execution.
- Test and debug programs that do not have the source available.
- Display called module stacking.
The called module configuration such as the load address, entry point, size, attribute, AMODE, RMODE, and language can be retrieved.
- Maintain multiple profiles.
Code Debug TSO’s Profile Handling facility provides a flexible and easy-to-use method for using and maintaining multiple profiles. Multiple profiles are used because some of the data you see during a Code Debug TSO debugging session depends on the current profile. This includes installation defaults established by your system programming staff, and most importantly, environment parameters and setup options for the debugging session.