COBOL Manual for TNS/E Programs (H06.08+, J06.03+)

15 Debugging Tools
This section briefly describes the HP debugging tools and refers you to appropriate sources for
more information.
CAUTION: If you use the CODECOV (page 542) compiler directive to direct your compiler to
generate instrumented object code, the Code Coverage Utility connects to the application program
as a debugger to read its memory and so on.
This causes all the debug requests to wait until the Code Coverage Utility (the active debugger)
detaches from the application. The Code Coverage Utility only detaches after the instrumented
application stops.
Therefore, if you must debug an instrumented application, it should be started in debug mode by
using the TACL RUND or RUNV commands.
For more information, see Generating Instrumented Object Code for Use With the Code Coverage
Tool (page 525).
Debugging Lines
Debugging lines, a batch-oriented COBOL debugging tool, apply to individual source program
lines.
Debugging lines are compiled only if the source program includes a DEBUGGING MODE clause
(see SOURCE-COMPUTER Paragraph (page 102)); otherwise, they are handled as comments.
NOTE: The code that the compiler generates when it compiles debugging lines and debugging
declaratives is not the same as the code that it generates when it ignores them. The additional
code that the compiler generates for the debugging lines and debugging declaratives can alter
the alignment of data items and cause the program to behave differently.
You can put debugging lines anywhere in a source program. You usually use them to report values
of data items at strategic points in the program.
A debugging line has the letter D or d in the indicator area (column 1 in Tandem reference format,
column 7 in ANSI reference format). If a debugging line contains a COPY statement, every line
that the COPY statement introduces inherits the D or d in its indicator column.
Run-Time Debuggers
The HP run-time debuggers are Native Inspect and Visual Inspect. Native Inspect is a command
line debugger that runs on the NonStop server. Visual Inspect runs on the PC and provides a
graphical user interface (GUI). Both Native Inspect and Visual Inspect provide an interactive,
symbolic debugging capability.
Native Inspect replaces Inspect and Debug in the TNS/E programming environment. It provides
most of the same capabilities, including maching-level debugging, as Inspect and Debug, although
the Native Inspect command syntax differs from Inspect and Debug. Native Inspect is based on
the industry-standard GDB debugger.
If you compile your program with the SYMBOLS directive (described in SYMBOLS and NOSYMBOLS
(page 577)), the symbolic debuggers allow you to debug the program using the names you assigned
to the procedures and data items of the source program, rather than the addresses that the compiler
and linker ultimately assigned to them. If you do not compile your program with the SYMBOLS
directive, you can use only the low-level commands of a symbolic debugger.
NOTE: When you have debugged the program, recompile it without the SYMBOLS directive to
decrease the size of the object file and decrease program compilation time.
Debugging Lines 699