![]() | ![]() ![]() ![]() ![]() | Programming Guide |
Create event trace and dump files
int sm_trace(char *commands);
commands
- Command to execute.
- 0 no errors found in
commands
.
- ·
SM_EQUALS
: No equal sign following aDUMPFILE
;FRAMES
orTRACEFILE
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 aDUMPFILE
orTRACEFILE
command.
- ·
SM_NOT_LOADED
:DUMP
command whenDUMPFILE
is not specified.
- ·
SM_NUMBER
:DUMP
command whenFRAMES
is zero or theFRAMES
command value is not one or more digits.
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 aSMVARS
orSMSETUP
setup file, for example:
SMTRACE=NOJAVA FRAMES=100 TRACEFILE="c:\temp\forex.trc"
SMINITJPL
in a setup file can also be used to callsm_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.
![]()
![]()
![]()
![]()