home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Oakland CPM Archive
/
oakcpm.iso
/
sigm
/
vol179
/
trace.lbr
/
TRACE.DQC
/
TRACE.DOC
Wrap
Text File
|
1985-02-09
|
3KB
|
86 lines
TRACE.DOC ver. 1.1
This is a simple-minded trace facility for Aztec CII
programs. When it is in operation, the C program prints out
each source code line to CON: before executing it. It may be
helpful for debugging C programs. The idea is very simple.
The CII compiler can be requested to place the source code line
into the .ASM file preceeding the assembler code generated by
that line (the -T option). The program TRACE reads such an
.ASM file and writes a .TRA trace file where this is replaced
by a call to a routine TRACE1 that prints out the source code
line to the console (NOT to stdout).
--------------------------------------------------------------
The files required for TRACE are:
TRACE.DOC documentation
TRACE.C trace program
TRACE1.ASM run-time subroutine
First, TRACE.C should be compiled and assembled. This can
be done by the following commands: (Alternatives for Microsoft
M80 use are in square brackets [] .)
A>CII TRACE.C [ A>CII -M TRACE.C ]
Compilation produces TRACE.ASM.
A>AS TRACE.ASM [ A>M80 =TRACE.ASM/M ]
Assembly produces TRACE.O [TRACE.REL].
A>ERA TRACE.ASM [ A>ERA TRACE.ASM ]
Removes an unneeded file from the disk.
A>LN TRACE.O LIBC.LIB [ A>L80 TRACE/N,TRACE,SOFTLIB/S/E ]
Use your own library here. Link produces TRACE.COM.
A>ERA TRACE.O [ A>ERA TRACE.REL ]
Next, a relocatable module must be created from
TRACE1.ASM. This is done as follows:
A>AS TRACE1.ASM [ A>M80 =TRACE1.ASM ]
Produces relocatable object file TRACE1.O [TRACE1.REL].
--------------------------------------------------------------
When these steps have been completed, you are ready to use
TRACE. You should have the two files TRACE.COM and TRACE1.O
[or TRACE1.REL] on any disk where you want to prepare a trace.
To trace the program TEST.C, for example, the following
commands would be used: (I have a SUBMIT file prepared to do
this sequence automatically.)
A>CII -T TEST.C [ A>CII -MT TEST.C ]
The -T option must be used. This creates TEST.ASM.
A>TRACE TEST [ A>TRACE TEST ]
This creates TEST.TRA.
A>ERA TEST.ASM [ A>ERA TEST.ASM ]
A>AS TEST.TRA [ A>M80 =TEST.TRA/M ]
This creates TEST.O [or TEST.REL].
A>ERA TEST.TRA [ A>ERA TEST.TRA ]
A>LN TEST.O TRACE1.O MY.LIB MATH.LIB LIBC.LIB
[ A>L80 TEST/N,TEST,TRACE1,MYLIB/S,MATHLIB/S,CLIB/S/E ]
Use your own libraries here.
A>ERA TEST.O [ A>ERA TEST.REL ]
Now TEST.COM should exist. When it is executed, it will
be traced.
--------------------------------------------------------------
NOTE: While a trace is in effect, the following control
codes will be operable:
^S freeze the program
^Q restart after ^S
^T stop trace printout, but continue program
^R restart trace printout
^C exit to CP/M
I hope this weapon will be of some small use in the
endless contest with the bug.
Gerald A. Edgar September 4, 1983
107 W. Dodridge St.
Columbus, OH 43202
CIS 70715,1324
>CII -MT TEST.C ]
The -