Debugging without hooks, statement tables, and symbol tables

z/OS® Debugger can gain control at program initialization by using the PROMPT suboption of the TEST run-time option. Even when you have removed all hooks and the statement and symbol tables from a production program, z/OS Debugger receives control when a condition is raised in your program if you specify ALL or ERROR on the TEST run-time option, or when a __ctest(), CEETEST, or PLITEST is executed.

When z/OS Debugger receives control in this limited environment, it does not know what statement is in error (no statement table), nor can it locate variables (no symbol table). Thus, you must use addresses and interpret hexadecimal data values to examine variables. In this limited environment, you can:
  • Determine the block that is in control:
    list (%LOAD, %CU, %BLOCK);
    or
    list (%LOAD, %PROGRAM, %BLOCK);
  • Determine the address of the error and of the compile unit:
    list (%ADDRESS, %EPA);  (where %EPA is allowed)
  • Display areas of the program in hexadecimal format. Using your listing, you can find the address of a variable and display the contents of that variable. For example, you can display the contents at address 20058 in a C and C++ program by entering:
    LIST STORAGE (0x20058);
    To display the contents at address 20058 in a COBOL or PL/I program, you would enter:
    LIST STORAGE (X'20058');
  • Display registers:
    LIST REGISTERS;
  • Display program characteristics:
    DESCRIBE CU;  (for C)
    
    DESCRIBE PROGRAM;  (for COBOL)
  • Display the dynamic block chain:
    LIST CALLS;
  • Request assistance from your operating system:
    SYSTEM ...;
  • Continue your program processing:
    GO;
  • End your program processing:
    QUIT;

If your program does not contain a statement or symbol table, you can use session variables to make the task of examining values of variables easier.

Even in this limited environment, HLL library routines are still available.

Programs that are compiled with the following combination of compilers and compiler options can have the best performance and smallest module size, while retaining full debugging capabilities:

  • Enterprise COBOL for z/OS Version 5 and Version 6, with the TEST compiler option.
    Note: For Version 5, Version 6 Release 1, and Version 6 Release 2 and later with the TEST(NOSEPARATE) compiler option, the debug information in this case is kept in a NOLOAD segment in the program object that is only loaded when the debugger is active.
  • Enterprise COBOL for z/OS Version 4, with the TEST(NOHOOK,SEPARATE) compiler option.
  • Enterprise COBOL for z/OS and OS/390® Version 3, with the TEST(NONE,SYM,SEPARATE) compiler option.
  • COBOL for OS/390 & VM Version 2, with the TEST(NONE,SYM,SEPARATE) compiler option.
  • Enterprise PL/I for z/OS Version 3.5 or later, with the TEST(ALL,SYM,NOHOOK,SEPARATE) compiler option.