Debugging a sourceless program
Code Debug TSO allows you to interactively debug programs that do not have the source available (no source listing in the DDIO). You can choose either of two available methods.
If requested, Code Debug TSO can create a “pseudo-assembler” view of the object code. With this method, a temporary source member will be created. This allows you to debug main programs and subprograms while employing the same strategy you would use if a DDIO source listing had been created during assembly. See Creating Pseudo-Assembler Source for more information.
You can also choose to use Code Debug’s traditional support for programs without source. With this support, you can debug “sourceless” main programs, subprograms, or GETMAINed areas in the same manner as interactive source level debugging, with a few differences. Test session setup and startup is the same as setting up a session to interactively debug at the source level. The differences occur during the debugging session:
- Code Debug TSO debugging commands such as AFTER, BEFORE, COUNT, ONETIME, SKIP, TRACE, WHEN, PEEK, KEEP, GOTO, and DELETE cannot be used.
- To set a breakpoint, you must use the AT command, which sets a before breakpoint.
When the AT breakpoint is reached, the AT Display screen shows your sourceless program in dump format. You can enter Code Debug TSO debugging commands such as GPREGS, MEMORY, SHOW, and so on.
Accessing a sourceless main program
When program execution begins and the main program does not have source, the session log is automatically displayed with the message,
NO SOURCE LISTING DATA SET MEMBER FOR procedure-name.
See the following figure.
Session Log Showing No Source Message for a Main Procedure
COMMAND ===> SCROLL ===> CSR
NO SOURCE LISTING DATA SET MEMBER FOR TRIMINP1
---------------------------------------------------------- Before TRIMINP1 ->
********************************* TOP OF DATA *******************************
+-----------------------------------------------------------------------------+
: JOB: FLGDAA1 :
: CODE DEBUG TSO REL 17.02.00 CUSTOMER # 010000 STEP: ATSOPROC :
: DATE: 04/01/2023 :
: BMC ONLINE LICENSING TIME: 08.17.37 :
: SYSTEM: SYS1 :
+-----------------------------------------------------------------------------+
:
+---------------------------------------------------------------------------+
XPED TSO SPF
TEST TRIMAINP
*** TRIMAINP FROM FLGDAA1.TEST62.LOADLIB LINK 02/22/1995
******************************** BOTTOM OF DATA *****************************
You can use the AT command on the Log screen to set a breakpoint in the specified program if you are familiar with the program. However, if you are not familiar with the program, you can use the MEMORY command to display the program in dump format. For example:
displays the Memory screen showing a dump of TRIMAINP.
The AT command can then be entered to set breakpoints in the program. Issuing the AT command will also load the module into memory if it is not loaded. The full syntax of the AT command is provided in the Command-and-syntax-reference.
For example, entering the following on the Memory screen displays the At Display screen shown in the following figure.
AT Display Screen
COMMAND ===> SCROLL ===> CSR
AT ADDRESS 08267B14 : 90ECD00C : STM 14,12,12(13)
--------------------------------------------------------- Before TRIMINP1+C --
BASE = 08267B08 0 - 2 - 4 - 6 - 8 - A - C - E - = 0-2-4-6-8-A-C-E-
******************************* TOP OF DATA **********************************
00000C ===> 00ECD00C 47F0F04C 08268180 00000168 = ..}..00<........
00001C ===> 08267FF0 00000000 08267B40 A8000000 = ..~0......# ....
00002C ===> 00010100 00000000 00000000 00000000 = ................
00003C ===> 80000000 01002000 08267FF4 0000000B = ..........~4....
00004C ===> 08267B14 00000000 00000000 5830F010 = ..#...........0.
00005C ===> 5810D04C 5800F00C 1E015500 C00C47D0 = ..}<..0.....{...
00006C ===> F06858F0 C07405EF 58E0D048 18F090E0 = 0..0{....\}..0..
00007C ===> 104850D0 100441D1 000092A0 D0009221 = ..&}...J....}...
00008C ===> D0019202 D0761B88 5080D140 4180D140 = }...}...&.J ..J.
00009C ===> 5080D060 D203D054 30705840 30BC1884 = &.}-K.}.... ....
0000AC ===> 5080D144 9206D149 9213D148 D701D14A = &.J...J...J.P.J.
0000BC ===> D14A0520 D207D0C0 306841B0 D0D050B0 = J¢..K.}{....}}&.
0000CC ===> D0C058E0 307450E0 D1504180 D0D05080 = }{.\..&J&..}}&.
0000DC ===> D1545F80 30785080 D15450D0 D16441F0 = J.¨...&.J.&}J...
0000EC ===> 317050F0 D1605850 307C5050 D1585050 = ..&0J-.&.@&&J.&.
0000FC ===> D1585880 D1545E80 30785080 D1545870 = J...J.;...&.J...
00010C ===> D1605870 700007F7 5870D154 D2147000 = J-.....7..J.K...
00011C ===> 31105850 D1584650 293A50D0 D1644170 = ...&J..&..&}J...
If the address specified with the AT command is not a valid instruction (data or privileged), a message is returned. Also, if the specified program has source, no breakpoint is set and the message MODULE HAS SOURCE; USE Code Debug BREAKPOINT COMMANDS is displayed.
On the AT Display screen, the offset and the instruction pointer are highlighted, indicating where the breakpoint is set. The message area contains the breakpoint address and the instruction in hexadecimal and mnemonic form. If the AT command is used on an address and not in a module loaded by Code Debug TSO, the compile date and time displayed on the third line will be blank.
Accessing a sourceless subprogram
When your debugging session begins and your main program has source, the Source display screen is displayed. You can set breakpoints in the regular manner on this screen.
Normally, breakpoints can be set in a subprogram by entering a fully qualified breakpoint command or using the SOURCE or INTERCEPT commands to access the subprogram from this screen. However, if the subprogram does not have source, the message NO SOURCE LISTING INFORMATION FOUND FOR MODULE is displayed at the top of the source display.
If you are not familiar with the program, you can use the MEMORY command to access main storage and display the module in dump format on the Memory screen. For example:
With the program displayed on the Memory screen, you can decide exactly where you want to set breakpoints using the AT command.
If you are familiar with the application you are debugging, you can use the AT command with the module/procedure name to set a breakpoint at the 0 displacement in the module. For example:
When the AT breakpoint is encountered, the AT Display screen shown in the above figure displayed and program execution is paused at the specified offset.
Using Code Debug TSO commands for sourceless debugging
The rules for using Code Debug TSO commands for sourceless debugging are as follows:
Primary Commands
None of the debugging commands, such as, AFTER, BEFORE, COUNT, ONETIME, SKIP, TRACE, WHEN, PEEK, KEEP, GOTO, GO n, and DELETE are valid. The GO command is valid. All other commands can be used.
Line Commands
The only valid line commands are X (eXclude) and T (Template). To insure proper results, the rest of the line command area should be blanked out after entering the line command.
The following are examples of using some Code Debug TSO commands to debug a sourceless program.
Using the UP command on the AT Display screen scrolls the screen toward the beginning of the module/procedure. Scrolling beyond the beginning of the module/procedure displays negative offsets. Using the LOCATE * command scrolls to the current execution point.
The GPREGS command can be used to open a modifiable window at the bottom of your screen. The register values displayed can be changed by typing over the values. An example of the GPREGS window is shown in the following figure.
GPREGS Window on the AT Display Screen
COMMAND ===> SCROLL ===> CSR
PROGRAM: TRIMINP1 MODULE: TRIMAINP COMP DATE: 02/22/1995 COMP TIME: 19:44:00
--------------------------------------------------------- Before TRIMINP1+C --
BASE = 08267B08 0 - 2 - 4 - 6 - 8 - A - C - E - = 0-2-4-6-8-A-C-E-
******************************* TOP OF DATA **********************************
00000C ===> 00ECD00C 47F0F04C 08268180 00000168 = ..}..00<........
00001C ===> 08267FF0 00000000 08267B40 A8000000 = ..~0......# ....
00002C ===> 00010100 00000000 00000000 00000000 = ................
00003C ===> 80000000 01002000 08267FF4 0000000B = ..........~4....
00004C ===> 08267B14 00000000 00000000 5830F010 = ..#...........0.
00005C ===> 5810D04C 5800F00C 1E015500 C00C47D0 = ..}<..0.....{...
00006C ===> F06858F0 C07405EF 58E0D048 18F090E0 = 0..0{....\}..0..
00007C ===> 104850D0 100441D1 000092A0 D0009221 = ..&}...J....}...
00008C ===> D0019202 D0761B88 5080D140 4180D140 = }...}...&.J ..J.
00009C ===> 5080D060 D203D054 30705840 30BC1884 = &.}-K.}.... ....
0000AC ===> 5080D144 9206D149 9213D148 D701D14A = &.J...J...J.P.J.
0000BC ===> D14A0520 D207D0C0 306841B0 D0D050B0 = J¢..K.}{....}}&.
0000CC ===> D0C058E0 307450E0 D1504180 D0D05080 = }{.\..&J&..}}&.
0000DC ===> D1545F80 30785080 D15450D0 D16441F0 = J.¨...&.J.&}J...
GPREGS R0 ==> 000C2000 R1 ==> 00000000 R2 ==> 001920B4 R3 ==> 00181100
R4 ==> 00000001 R5 ==> 00000000 R6 ==> 08267B14 R7 ==> 00192000
R8 ==> 00000001 R9 ==> 000000A0 R10 ==> 00179038 R11 ==> 00000000
R12 ==> 00179BF8 R13 ==> 001921D0 R14 ==> 80181580 R15 ==> 08267B00
Data and instruction areas can be typed over, as long as a breakpoint is not set on the instruction being typed over.
The SHOW ACTIVE command can be entered to display a summary of general-purpose register contents, PSW, and some control block information. The result of the SHOW ACTIVE command is shown in the following figure.
SHOW ACTIVE Display Screen
COMMAND ===> SCROLL ===> CSR
PROGRAM: TRIMINP1 MODULE: TRIMAINP COMP DATE: 02/22/1995 COMP TIME: 19:44:00
--------------------------------------------------------- Before TRIMINP1+C --
**************************** TOP OF DATA **********************************
GPREGS R0 ==> 000C2000 R1 ==> 00000000 R2 ==> 001920B4 R3 ==> 00181100
R4 ==> 00000001 R5 ==> 00000000 R6 ==> 08267B14 R7 ==> 00192000
R8 ==> 00000001 R9 ==> 000000A0 R10 ==> 00179038 R11 ==> 00000000
R12 ==> 00179BF8 R13 ==> 001921D0 R14 ==> 80181580 R15 ==> 08267B00
PSW XRXXXTIE KEY CMWP SH CC PROGMASK AMODE INSTR ADDR
00000111 8 1101 00 00 1110 1 88267B16
INSTR
ADDRESS 08267B14 : 90ECD00C
OPCODE STM
OP1 R14 : 80181580
R12 : 00179BF8
OP2 001921DC : 40404040404040404040404040404040404040404040404040404040
TCB 008A7D90
ASID 01A5
CVT 00FD44B0
JSCB 008FD1F4
TIOT 008DB000
The END command returns you to the previously displayed AT Display screen as shown above.
The SHOW AT command can also be entered to display all the outstanding breakpoints set by the AT command.
Use the DELETE AT command to remove all outstanding AT breakpoints.