Programming Guide |
Create event trace and dump files
int sm_trace(char *commands);
commands
- Commands to execute.
- · 0: no errors found in
commands
.
- ·
SM_EQUALS
: No equal sign following a DUMPFILE; FRAMES or TRACEFILE command.
- ·
SM_FORMAT
: a non-alphabetic character was found in a command.
- ·
SM_MALLOC
: a call to the malloc C function has failed.
- ·
SM_MISSARGS
: commands is the null pointer; the null string or just whitespace.
- ·
SM_NOFILE
: unable to open the file in a DUMPFILE or TRACEFILE command.
- ·
SM_NOT_LOADED
: DUMP command when DUMPFILE is not specified.
- ·
SM_NUMBER
: DUMP command whenFRAMES
is zero or theFRAMES
command value is not one or more digits.
- ·
SM_QUOTE
: DUMPFILE or TRACEFILE value starts with a quote character but a matching terminating quote was not found.
- ·
SM_SYNTAX
: character after the closing quote in a DUMPFILE or TRACEFILE is not aNUL
or whitespace.
sm_trace
can create trace and dump files containing information about Panther events. The events that are reported in these files can be selected. Thecommands
parameter is series of command tokens that control operations. Most tokens can be prefixed withNO
to reverse their effect. The case of tokens is ignored but they will be capitalized in this manual.
sm_trace
was first released in Panther 5.30.Trace files are written as events occur. The following commands control trace files:
Dump files are written when the
DUMP
command is executed. The number of events to store for reporting is controlled by theFRAMES=
command. The following commands control dump files:The following commands control how files are opened:
OVERWRITE
Specifies that existing files should be overwritten. It is the default.
APPEND
Specifies that existing files should be appended to.
The following commands control which events are to be logged:
The following command causes parameters to be displayed:
PARMS
Causes parameters to be displayed for calls to functions, including JPL functions. The default is
NOPARMS
.To enable tracing to begin at startup, the SMTRACE application variable can be included in a SMVARS or SMSETUP setup file, for example:
SMTRACE=NOJAVA FRAMES=100 TRACEFILE="c:\temp\forex.trc"
SMINITJPL in a setup file can also be used to call
sm_trace
, for example:
SMINITJPL=call sm_trace('PARMS TRACEFILE="c:\temp\forex.trc"')
When debugging a program,
sm_trace
can be called from the debugger to produce a dump file. For example, one can call:
sm_trace("DUMPFILE='dump1.dmp' DUMP")
to create a dump file named "dump1.dmp" with the most recent trace information.