Debugging a sourceless program with Assembler
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 module-name. See the following figure.
Session Log Showing No Source Message for a Driver Program
COMMAND ===> SCROLL ===> CSR
NO SOURCE LISTING DATA SET MEMBER FOR TRIMAINA
---------------------------------------------------------- Before TRIMAINA ->
********************************* 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 TRIMAINA
*** TRIMAINA 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:
MEMORY TRIMAINA:
displays the Memory screen showing a dump of TRIMAINA.
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 following figure.
AT Display Screen
COMMAND ===> SCROLL ===> CSR
AT ADDRESS 001120F0 : 90ECD00C : STM 14,12,12(13)
----------------------------------------------------------- Before TRIMAINA --
BASE = 001120F0 0 - 2 - 4 - 6 - 8 - A - C - E - = 0-2-4-6-8-A-C-E-
******************************* TOP OF DATA **********************************
000000 ===> 00ECD00C 18CF41B0 C0F050DB 000450BD = ..}.....{0&...&.
000010 ===> 000818DB 4510C01C 80112228 0A139110 = ......{.........
000020 ===> C1684780 C0D8F810 C199C1F8 F810C19B = A...{Q8.A.A88.A.
000030 ===> C1F8F810 C19DC1F8 F810C19F C1F84110 = A88.A.A88.A.A8..
000040 ===> C1384100 C1A21FFF BFF71031 05EF92F0 = A...A....7.....0
000050 ===> C1A10700 47F0C05C 00113E5C 4110C064 = A•...0{*......{.
000060 ===> 47F0C068 00112291 58F0C058 05EF95F1 = .0{......0{....1
000070 ===> C1A14780 C09295F2 C1A14780 C09C95F3 = A•..{..2A•..{..3
000080 ===> C1A14780 C0A695F4 C1A14780 C0B047F0 = A•..{..4A•..{..0
000090 ===> C03EFA10 C199C1F9 47F0C03E FA10C19B = {...A.A9.0{...A.
0000A0 ===> C1F947F0 C03EFA10 C19DC1F9 47F0C03E = A9.0{...A.A9.0{.
0000B0 ===> FA10C19F C1F947F0 C03E0700 47F0C0C4 = ..A.A9.0{....0{D
0000C0 ===> 00113EA4 4110C0CC 47F0C0D0 00112289 = ......{..0{}....
0000D0 ===> 58F0C0C0 05EF0700 4510C0E0 80112228 = .0{{......{\....
0000E0 ===> 0A1458DD 000498EC D00C07FE 00000000 = ........}.......
0000F0 ===> 00000000 00000000 00000000 00000000 = ................
000100 ===> 00000000 00000000 00000000 00000000 = ................
000110 ===> 00000000 00000000 00000000 00000000 = ................
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:
MEMORY TRIMAINA:
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:
AT TRIMAINA:
When the AT breakpoint is encountered, the above figure is 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 following figure.
GPREGS Window on the AT Display Screen
COMMAND ===> SCROLL ===> CSR
PROGRAM: TRIMAINA MODULE: TRIMAINA COMP DATE: 02/22/1995 COMP TIME: 19:44:00
------------------------------------------------------------- Before TRIMAINA --
BASE = 001120F0 0 - 2 - 4 - 6 - 8 - A - C - E - = 0-2-4-6-8-A-C-E-
******************************* TOP OF DATA **********************************
000000 ===> 00ECD00C 18CF41B0 C0F050DB 000450BD = ..}.....{0&...&.
000010 ===> 000818DB 4510C01C 80112228 0A139110 = ......{.........
000020 ===> C1684780 C0D8F810 C199C1F8 F810C19B = A...{Q8.A.A88.A.
000030 ===> C1F8F810 C19DC1F8 F810C19F C1F84110 = A88.A.A88.A.A8..
000040 ===> C1384100 C1A21FFF BFF71031 05EF92F0 = A...A....7.....0
000050 ===> C1A10700 47F0C05C 00113E5C 4110C064 = A•...0{*......{.
000060 ===> 47F0C068 00112291 58F0C058 05EF95F1 = .0{......0{....1
000070 ===> C1A14780 C09295F2 C1A14780 C09C95F3 = A•..{..2A•..{..3
000080 ===> C1A14780 C0A695F4 C1A14780 C0B047F0 = A•..{..4A•..{..0
000090 ===> C03EFA10 C199C1F9 47F0C03E FA10C19B = {...A.A9.0{...A.
0000A0 ===> C1F947F0 C03EFA10 C19DC1F9 47F0C03E = A9.0{...A.A9.0{.
0000B0 ===> FA10C19F C1F947F0 C03E0700 47F0C0C4 = ..A.A9.0{....0{D
0000C0 ===> 00113EA4 4110C0CC 47F0C0D0 00112289 = ......{..0{}....
0000D0 ===> 58F0C0C0 05EF0700 4510C0E0 80112228 = .0{{......{\....
GPREGS R0 ==> 0009F000 R1 ==> 80097CA0 R2 ==> 80113BFC R3 ==> 8009768A
R4 ==> 081ACE90 R5 ==> 081A0EC8 R6 ==> 00000000 R7 ==> 8013E300
R8 ==> 081B0DE4 R9 ==> 8819BECA R10 ==> 0009F000 R11 ==> 00113B00
R12 ==> 8013E1B0 R13 ==> 00147140 R14 ==> 00115B94 R15 ==> 001120F0
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 following figure.
SHOW ACTIVE Display Screen
COMMAND ===> SCROLL ===> CSR
PROGRAM: TRIMAINA MODULE: TRIMAINA COMP DATE: 02/22/1995 COMP TIME: 19:44:00
------------------------------------------------------------- Before TRIMAINA --
***************************** TOP OF DATA **********************************
GPREGS R0 ==> 0009F000 R1 ==> 80097CA0 R2 ==> 80113BFC R3 ==> 8009768A
R4 ==> 081ACE90 R5 ==> 081A0EC8 R6 ==> 00000000 R7 ==> 8013E300
R8 ==> 081B0DE4 R9 ==> 8819BECA R10 ==> 0009F000 R11 ==> 00113B00
R12 ==> 8013E1B0 R13 ==> 00147140 R14 ==> 00115B94 R15 ==> 001120F0
PSW XRXXXTIE KEY CMWP SH CC PROGMASK AMODE INSTR ADDR
00000111 8 1101 00 00 0000 0 001120F2
INSTR
ADDRESS 001120F0 : 90ECD00C
OPCODE STM
OP1 R14 : 00115B94
R12 : 8013E1B0
OP2 0014714C : 8013E42680051AF80009F0000014710880113BFC8009768A081ACE900
TCB 0088EA18
ASID 01AD
CVT 00FD44B0
JSCB 008FD1F4
TIOT 008DB000
The END command returns you to the previously displayed AT Display screen as shown in GPREGS Window on the AT Display Screen.
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.