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.

Creating pseudo-assembler source for COBOL


Code Debug TSO allows you to interactively debug programs for which source is not available (no source listing in the DDIO), such as old modules which were compiled before Code Debug was acquired. By entering the PSEUDOSOURCE command (commonly abbreviated as PSEUDOSO, PSEUDO, or PS), you can display pseudo-assembler source on the Code Debug TSO Source screen.

This feature enables you to debug main programs and subprograms in much the same way as with Code Debug’s interactive source level debugging. Test session setup and startup is the same as for interactive debugging at the source level. Only minor differences occur during the debugging session.

Pseudo-Source Creation for a 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 as shown in the following figure.

No Source Message

-------------------------- CODE DEBUG TSO - LOG ----------------------------
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 SCTSO11.TEST74.LOADLIB                        LINK 10/19/9
******************************** BOTTOM OF DATA ****************************


You can enter the PSEUDOSOURCE command on the Log screen to request a pseudo-assembler view of the object module. For more information on using the PSEUDOSOURCE command, see the Command-and-syntax-reference. In this example, you would enter the command with the name of the target program as a parameter:

    PSEUDO TRIMAINA

Code Debug TSO would create a pseudo-assembler view of the program and display it on the Source screen as shown in the following figure.

Pseudo-Assembler on Source Screen 

------------------------- CODE DEBUG TSO - SOURCE ----------------------------
COMMAND ===>                                                  SCROLL ===> CSR
PROGRAM: TRIMAIANA  MODULE: TRIMAINA COMP DATE:  10/19/1999 COMP TIME:13:57:00
        ** END **




------   -------------------------------------------------- Before TRIMAINA ->
******************************** TOP OF MODULE ********************************
------                   TRIMAINA  CSECT
000000    90EC D00C        STM   R14,R12,12(R13)                    *..}.*
000004    18CF             LR    R12,R15                            *..*
000006    41B0 C0F8        LA    R11,248(,R12)                      *..{8*
00000A    50DB 0004        ST    R13,4(R11)                         *&...*
00000E    50BD 0008        ST    R11,8(R13)                         *&¨..*
000012    18DB             LR    R13,R11                            *..*
000014    4100 C01C        LA    R0,28(,R12)                        *..{.*
000018    47F0 C024        B     36(,R12)                           *.0{.*
00001C                     DC    CL6'TRITAD'
000022    4040 1B11        STH   R4,2833(,R1)                       *  ..*
000026    0A08             SVC   8              LOAD                *..*
000028    5000 C1A0        ST    R0,416(,R12)                       *&.A.*
00002C    4100 C034        LA    R0,52(,R12)                        *..{.*

Each line of the pseudo-assembler source view is composed of a hex representation of the instruction on the left, the assembler equivalent in the center, and a character representation on the right. The screen is formatted the same as the standard view presented when a DDIO source listing is available. From this screen, breakpoints can be set and stepping initiated in the same way as when debugging an Assembler application with source.

Important

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

Pseudo-Source Creation for a Subprogram

When your debugging session begins and your main program does have source, the Source screen is displayed. You can set breakpoints in the regular way on this screen.

Normally, you would set breakpoints in a subprogram by entering a fully qualified breakpoint command or by using the SOURCE or INTERCEPT commands to access the subprogram from this screen. However, if the subprogram did not have source, the message NO SOURCE LISTING INFORMATION FOUND FOR MODULE would be displayed at the top of the source display.

You can use the PSEUDO command at this point (or before entering the SOURCE or INTERCEPT command, if you know no source listing member exists) to bring up the pseudo-assembler view. For example, if the subroutine TRISUB was linked into a multi-CSECT object TRIPAK, the command would be entered as follows:

   PSEUDO TRIPAK::TRISUB:

Debugging a Pseudo-Source Program

The PSEUDO command is used to generate a pseudo-assembler source view of a program. Even if the original source used to create the program was a high-level language such as COBOL or C, the pseudo-source view will be displayed as assembler.

Code Debug TSO analyzes the object code to construct an assembler interpretation. Because this source view is an approximation of the assembler code corresponding to the machine code, you should have assembler knowledge in order to verify and step through the displayed image.

A DDIO source listing and a pseudo-assembler view cannot co-exist for a single program during an Code Debug test session. You can either use the DDIO source listing for a program (with a TEST, INTERCEPT, or initial SOURCE command, for example), or create a pseudo-assembler view for the program by entering the PSEUDO command. The command that is entered first will determine which source is used for the rest of the session.

Unlike when using the INTERCEPT command, when the pseudo-assembler view is first displayed using the PSEUDO command, no breakpoints are set. You must set a breakpoint in order to have execution pause in the desired module.

Before setting a breakpoint, you should verify that the assembler code is accurate. It is possible for Code Debug to have misinterpreted some data elements as instructions. This may cause errors when setting breakpoints or stepping through the code, because Code Debug sometimes needs to place breakpoints on every instruction. To avoid this problem, you need to make Code Debug treat as data the code it previously identified as being an instruction. This is done by entering the SET DATA command for the applicable line. If you need to change the data line back to an instruction, enter the SET INSTR command.

If data is misinterpreted as an instruction, it is possible for Code Debug to lose track of the program’s instruction boundaries. In this situation, you should enter the PSEUDO command with the appropriate OFFSET parameter to indicate where Code Debug should restart its construction of a new assembler view. In the example shown in Pseudo-Assembler on Source Screen(above figure), you need to prevent Code Debug from treating the spaces after the literal TRITAD as a STORE HALFWORD instruction. To do this, make Code Debug analyze the code again, beginning at offset 24, by entering the following command:

   PS TRIMAINA 24

The new pseudo-assembler source generated by Code Debug is shown in the following figure.

Regenerated Pseudo-Assembler Source

------------------------- CODE DEBUG TSO - SOURCE -----------------------------
COMMAND ===>                                                  SCROLL ===> CSR
PROGRAM: TRIMAIANA  MODULE: TRIMAINA COMP DATE:  10/19/1999 COMP TIME:13:57:00
        ** END **




------   -------------------------------------------------- Before TRIMAINA ->
******************************** TOP OF MODULE ********************************
------                   TRIMAINA  CSECT
000000    90EC D00C        STM   R14,R12,12(R13)                    *..}.*
000004    18CF             LR    R12,R15                            *..*
000006    41B0 C0F8        LA    R11,248(,R12)                      *..{8*
00000A    50DB 0004        ST    R13,4(R11)                         *&...*
00000E    50BD 0008        ST    R11,8(R13)                         *&¨..*
000012    18DB             LR    R13,R11                            *..*
000014    4100 C01C        LA    R0,28(,R12)                        *..{.*
000018    47F0 C024        B     36(,R12)                           *.0{.*
00001C                     DC    CL6'TRITAD'
000022                     DC    CL2'  '
000024    1B11             SR    R1,R1                              *..*
000026    0A08             SVC   8              LOAD                *..*
000028    5000 C1A0        ST    R0,416(,R12)                       *&.A.*

When you are sure the pseudo-assembler view is accurate, you can start debugging using all the commands you would normally use for a program with a matching DDIO source listing. Primary and line commands can both be used, including BEFORE, AFTER, COUNT, ONETIME, and TRACE. Only limited output will be displayed for data-related commands such as PEEK and KEEP, because Code Debug has no information about a data element’s starting location, size, or data-type. The VERIFY and MEMORY commands can be used to view the underlying storage, and you can enter the GPREGS command to display the current contents of the general purpose registers in a modifiable window at the bottom of your screen. The SHOW ACTIVE command can also be entered to display a summary of register contents, the PSW, and some control block information.

You may still want to use the AT command instead of the PSEUDO command in certain situations, such as when you want to set a breakpoint in a memory location not contained in a loaded module.

 

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