Guardian Programmer's Guide

Table Of Contents
Writing a Command-Interpreter Monitor ($CMON)
Guardian Programmer’s Guide 421922-014
23 - 89
Debugging a TACL Monitor ($CMON)
Debugging a TACL Monitor ($CMON)
Replacing a standard $CMON with an untested program being debugged can lead to
unacceptable delays and inconvenience to the user community. You should therefore
name the TACL monitor program you are developing something other than $CMON
and follow the guidelines described in this subsection for debugging and testing.
Debugging and testing is made more difficult because TACL processes always make
requests to a process named $CMON—the TACL program is hard coded to do this.
Therefore you should use a TACL macro or some other program that simulates the
TACL part of the TACL/$CMON interface. A TACL Macro for Debugging and Testing a
$CMON Program, following, provides an example.
A TACL Macro for Debugging and Testing a $CMON Program
The following example shows a TACL macro that you can use for sending TACL
messages to a TACL monitor program and receiving and displaying the reply. This
example tests the TACL monitor for its response to Prelogon^msg, Config^msg, and
Logon^msg messages. It can easily be modified to test the response to other TACL
messages.
?TACL MACRO
==
== This TACL macro can be used as a template to test $CMON
== processes
==
#FRAME
== Structure for sending TACL messages to $CMON:
[#DEF to^cmon STRUCT
BEGIN
INT message^code VALUE 0;
BYTE group VALUE 101;
BYTE user VALUE 131;
INT cipri VALUE 0;
FNAME ciinffile VALUE $ztnt.#pty21;
FNAME cioutfile VALUE $ztnt.#pty21;
END;
]
== Structure for receiving the reply to a Prelogon^msg
== message:
[#DEF prelogon^reply STRUCT
BEGIN
INT reply^code;
CHAR reply^text (0:131);
END;
]