Space announcement This documentation space provides the same content as before, but the organization of the content has changed. The content is now organized based on logical branches instead of legacy book titles. We hope that the new structure will help you quickly find the content that you need.

Debugging a sourceless program for COBOL


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 for an example that shows the main program without source.

Session Log Showing No Source Message for a Driver Program

----------------------------- CODE DEBUG TSO - LOG ----------------------------
COMMAND ===>                                                    SCROLL ===> CSR
               NO SOURCE LISTING DATA SET MEMBER FOR TRIMAIN
-------------------------------------------------------------- Before TRIMAIN ->
********************************* 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 TRIMAIN
*** TRIMAIN 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 TRIMAIN:

displays the Memory screen showing a dump of TRIMAIN.

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.

Important

The AT command can also be entered in an initial script.

For example, entering the following on the Memory screen displays the AT Display screen shown in the following figure.

   AT TRIMAIN:;GO

AT Display Screen

------------------------- CODE DEBUG TSO - AT DISPLAY ------------------------
COMMAND ===>                                                  SCROLL ===> CSR
            AT ADDRESS  00119F68 : 90ECD00C     : STM 14,12,12(13)
----------------------------------------------------------- Before TRIMAIN --
BASE = 00119F68   0 - 2 -   4 - 6 -   8 - A -   C - E -   =  0-2-4-6-8-A-C-E-
******************************* TOP OF DATA **********************************
  000000   ===>  00ECD00C  185D05F0  4580F010  E3D9C9D4  =  ..}..).0..0.TRIM
  000010   ===>  C1C9D540  E5E2D9F1  0700989F  F02407FF  =  AIN VSR1....0...
  000020   ===>  96021034  07FE41F0  000107FE  0011A70A  =  .......0........
  000030   ===>  00119F68  00119F68  0011A410  0011A1A8  =  ..............~.
  000040   ===>  0011A474  0011A6CA  00000000  00000000  =  ................
  000050   ===>  00000000  00000000  00000000  00000000  =  ................
  000060   ===>  00000000  00000000  00000000  00000000  =  ................
  000070   ===>  00000000  00000000  00000000  00000000  =  ................
  000080   ===>  00000000  00000000  F1F94BF4  F44BF3F7  =  ........19.44.3.
  000090   ===>  C6C5C240  F2F26B40  F1F9F9F5  00000000  =  FEB 22, 1995....
  0000A0   ===>  C5D8E4C9  D3C1E3C5  D9C1D340  E3D9C9C1  =  EQUILATERAL TRIA
  0000B0   ===>  D5C7D3C5  E2000000  00C9E2D6  E2C3C5D3  =  NGLES....ISOSCEL
  0000C0   ===>  C5E240E3  D9C9C1D5  C7D3C5E2  40400000  =  ES TRIANGLES  ..
  0000D0   ===>  0000E2C3  C1D3C5D5  C540E3D9  C9C1D5C7  =  ..SCALENE TRIANG
  0000E0   ===>  D3C5E240  40404000  000000C9  D5E5C1D3  =  LES    ....INVAL
  0000F0   ===>  C9C440E3  D9C9C1D5  C7D3C5E2  40404040  =  ID TRIANGLES
  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 XPEDITER 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 TRIMAIN:

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 TRIMAIN:

When the AT breakpoint is encountered, the AT Display screen shown in GPREGS Window on the AT Display Screen 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.

Important

Typing over instructions with X’00A3’ will not be recognized as a breakpoint. A S0C1 abend occurs when the typed over instruction is executed.

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 

------------------------- CODE DBEUG TSO - AT DISPLAY -------------------------
COMMAND ===>                                                  SCROLL ===> CSR
 PROGRAM: TRIMAIN   MODULE: TRIMAIN   COMP DATE: 02/22/1995  COMP TIME: 19:44:00
----------------------------------------------------------- Before TRIMAIN --
BASE = 00119F68   0 - 2 -   4 - 6 -   8 - A -   C - E -   =  0-2-4-6-8-A-C-E-
******************************* TOP OF DATA **********************************
  000000   ===>  00ECD00C  185D05F0  4580F010  E3D9C9D4  =  ..}..).0..0.TRIM
  000010   ===>  C1C9D540  E5E2D9F1  0700989F  F02407FF  =  AIN VSR1....0...
  000020   ===>  96021034  07FE41F0  000107FE  0011A70A  =  .......0........
  000030   ===>  00119F68  00119F68  0011A410  0011A1A8  =  ..............~.
  000040   ===>  0011A474  0011A6CA  00000000  00000000  =  ................
  000050   ===>  00000000  00000000  00000000  00000000  =  ................
  000060   ===>  00000000  00000000  00000000  00000000  =  ................
  000070   ===>  00000000  00000000  00000000  00000000  =  ................
  000080   ===>  00000000  00000000  F1F94BF4  F44BF3F7  =  ........19.44.3.
  000090   ===>  C6C5C240  F2F26B40  F1F9F9F5  00000000  =  FEB 22, 1995....
  0000A0   ===>  C5D8E4C9  D3C1E3C5  D9C1D340  E3D9C9C1  =  EQUILATERAL TRIA
  0000B0   ===>  D5C7D3C5  E2000000  00C9E2D6  E2C3C5D3  =  NGLES....ISOSCEL
  0000C0   ===>  C5E240E3  D9C9C1D5  C7D3C5E2  40400000  =  ES TRIANGLES  ..
  0000D0   ===>  0000E2C3  C1D3C5D5  C540E3D9  C9C1D5C7  =  ..SCALENE TRIANG
  GPREGS R0  ==> 0009D000  R1  ==> 80095CA0  R2  ==> 80110BFC  R3  ==> 8009568A
         R4  ==> 0819EE90  R5  ==> 08192EC8  R6  ==> 00000000  R7  ==> 80142986
         R8  ==> 081A2DE4  R9  ==> 8818DECA  R10 ==> 0009D000  R11 ==> 00110B00
         R12 ==> 80142710  R13 ==> 00140730  R14 ==> 0011303C  R15 ==> 00119F6A

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

------------------------------ CODE DEBUG TSO - SHOW ---------------------------
COMMAND ===>                                                  SCROLL ===> CSR
PROGRAM: TRIMAIN   MODULE: TRIMAIN   COMP DATE: 02/22/1995  COMP TIME: 19:44:00
----------------------------------------------------------- Before TRIMAIN --
***************************** TOP OF DATA **********************************
GPREGS  R0  ==> 0009D000 R2  ==> 80095CA0 R2  ==> 80110BFC R3  ==> 8009568A
       R4  ==> 0819EE90 R5  ==> 08192EC8 R6  ==> 00000000 R7  ==> 80142986
       R8  ==> 081A2DE4 R9  ==> 8818DECA R10 ==> 0009D000 R11 ==> 00110B00
       R12 ==> 80142710 R13 ==> 00140730 R14 ==> 0011303C R15 ==> 00119F6A

PSW     XRXXXTIE   KEY   CMWP   SH  CC   PROGMASK   AMODE   INSTR ADDR
       00000111    8    1101   00  10     0000       0      00119F6A

INSTR
ADDRESS 00119F68 : 90ECD00C
OPCODE  STM
OP1     R14      : 0011303C
       R12      : 80142710
OP2     0014073C : 80142986801422080009D000001406F880110BFC8009568A0819EE900
TCB     0088EA18
ASID    01A5
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.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*