Debugging A Program; Output Files: Object, Executable, Listing, And Temporary Files - Compaq COBOL AAQ2G1FTK User Manual

Compaq computer accessories user manual
Table of Contents

Advertisement

Developing Compaq COBOL Programs
1.2 Developing Programs on Tru64 UNIX
Compiles the file
Uses
program file named
The files can also be compiled separately, as follows:
% cobol -c array_calc.cob
% cobol -c calc_aver.cob
% cobol -o calc mainprog.cob array_calc.o calc_aver.o
In this case, the
command creates the file
calc_aver.o
files into the executable program named
If your path definition includes the directory containing
program by simply typing its name:
% calc
You can compile multiple source files by concatenating them:
% cat proga1.cob proga2.cob proga3.cob > com1.cob
% cat progb1.cob progb2.cob > com2.cob
% cobol -c com1.cob com2.cob
The resulting file names are com1.o and com2.o. The OpenVMS Alpha equivalent
to this is:
$ COBOL proga1+proga2+proga3,progb1+progb2

1.2.2.6 Debugging a Program

To debug a program using the Ladebug Debugger, compile the source files
with the
debugging in the object and executable program files. The following
command also uses the
% cobol -g -o calc_debug mainprog.cob array_calc.cob calc_aver.cob
To debug an executable program named calc_debug, type the following command:
% ladebug calc_debug
For more information on running the program within the debugger, see the
Ladebug Debugger Manual.

1.2.2.7 Output Files: Object, Executable, Listing, and Temporary Files

The output produced by the
An object file, if you specify the
An executable file, if you omit the
A listing file, if you specify the
If the environment variable TMPDIR is set, the value is used as the directory for
temporary files.
You control the production of these files by specifying the appropriate flags on
the
cobol
single temporary object file, whether you specify one source file or multiple source
files separated by blanks. The
one executable image file.
1–16 Developing Compaq COBOL Programs
mainprog.cob
to link both the main program and object files into an executable
ld
calc
option prevents linking and retains the
-c
array_calc.o
. The last command compiles the main program and links the object
flag to request additional symbol table information for source line
-g
flag to name the executable program file
-o
cobol
command line. Unless you specify the
ld
, which contains the main program
. The second command creates the file
.
calc
calc
command includes:
flag on the command line
-c
-c
flag
flag
-V
flag, the compiler generates a
-c
linker is then invoked to link the object file into
files. The first
.o
, you can run the
cobol
:
calc_debug

Advertisement

Table of Contents
loading

Table of Contents