/********************************************************************** NAME : WatchMethod DESCRIPTION : Prints out a trace of the beginning or end of the execution of a generic function method INPUTS : A string to indicate beginning or end of execution RETURNS : Nothing useful SIDE EFFECTS : None NOTES : Uses the globals CurrentGeneric, CurrentMethod, ProcParamArraySize and ProcParamArray for other trace info **********************************************************************/ static void WatchMethod( Environment *theEnv, const char *tstring) { if (ConstructData(theEnv)->ClearReadyInProgress || ConstructData(theEnv)->ClearInProgress) { return; } WriteString(theEnv,STDOUT,"MTH "); WriteString(theEnv,STDOUT,tstring); WriteString(theEnv,STDOUT," "); if (DefgenericData(theEnv)->CurrentGeneric->header.whichModule->theModule != GetCurrentModule(theEnv)) { WriteString(theEnv,STDOUT,DefgenericModule(DefgenericData(theEnv)->CurrentGeneric)); WriteString(theEnv,STDOUT,"::"); } WriteString(theEnv,STDOUT,DefgenericData(theEnv)->CurrentGeneric->header.name->contents); WriteString(theEnv,STDOUT,":#"); if (DefgenericData(theEnv)->CurrentMethod->system) WriteString(theEnv,STDOUT,"SYS"); PrintUnsignedInteger(theEnv,STDOUT,DefgenericData(theEnv)->CurrentMethod->index); WriteString(theEnv,STDOUT," "); WriteString(theEnv,STDOUT," ED:"); WriteInteger(theEnv,STDOUT,EvaluationData(theEnv)->CurrentEvaluationDepth); PrintProcParamArray(theEnv,STDOUT); }
/*********************************************************** NAME : WatchMessage DESCRIPTION : Prints a condensed description of a message and its arguments INPUTS : 1) The output logical name 2) BEGIN_TRACE or END_TRACE string RETURNS : Nothing useful SIDE EFFECTS : None NOTES : Uses the global variables ProcParamArray and CurrentMessageName ***********************************************************/ globle void WatchMessage( void *theEnv, EXEC_STATUS, char *logName, char *tstring) { EnvPrintRouter(theEnv,execStatus,logName,"MSG "); EnvPrintRouter(theEnv,execStatus,logName,tstring); EnvPrintRouter(theEnv,execStatus,logName," "); EnvPrintRouter(theEnv,execStatus,logName,ValueToString(MessageHandlerData(theEnv,execStatus)->CurrentMessageName)); EnvPrintRouter(theEnv,execStatus,logName," ED:"); PrintLongInteger(theEnv,execStatus,logName,(long long) execStatus->CurrentEvaluationDepth); PrintProcParamArray(theEnv,execStatus,logName); }
/*************************************************** NAME : WatchDeffunction DESCRIPTION : Displays a message indicating when a deffunction began and ended execution INPUTS : The beginning or end trace string to print when deffunction starts or finishes respectively RETURNS : Nothing useful SIDE EFFECTS : Watch message printed NOTES : None ***************************************************/ static void WatchDeffunction( void *theEnv, char *tstring) { EnvPrintRouter(theEnv,WTRACE,"DFN "); EnvPrintRouter(theEnv,WTRACE,tstring); if (DeffunctionData(theEnv)->ExecutingDeffunction->header.whichModule->theModule != ((struct defmodule *) EnvGetCurrentModule(theEnv))) { EnvPrintRouter(theEnv,WTRACE,EnvGetDefmoduleName(theEnv,(void *) DeffunctionData(theEnv)->ExecutingDeffunction->header.whichModule->theModule)); EnvPrintRouter(theEnv,WTRACE,"::"); } EnvPrintRouter(theEnv,WTRACE,ValueToString(DeffunctionData(theEnv)->ExecutingDeffunction->header.name)); EnvPrintRouter(theEnv,WTRACE," ED:"); PrintLongInteger(theEnv,WTRACE,(long long) EvaluationData(theEnv)->CurrentEvaluationDepth); PrintProcParamArray(theEnv,WTRACE); }
/*********************************************************** NAME : WatchHandler DESCRIPTION : Prints a condensed description of a message-handler and its arguments INPUTS : 1) The output logical name 2) The handler address 3) BEGIN_TRACE or END_TRACE string RETURNS : Nothing useful SIDE EFFECTS : None NOTES : Uses the global variables ProcParamArray and CurrentMessageName ***********************************************************/ globle void WatchHandler( void *theEnv, EXEC_STATUS, char *logName, HANDLER_LINK *hndl, char *tstring) { HANDLER *hnd; EnvPrintRouter(theEnv,execStatus,logName,"HND "); EnvPrintRouter(theEnv,execStatus,logName,tstring); EnvPrintRouter(theEnv,execStatus,logName," "); hnd = hndl->hnd; PrintHandler(theEnv,execStatus,WTRACE,hnd,TRUE); EnvPrintRouter(theEnv,execStatus,logName," ED:"); PrintLongInteger(theEnv,execStatus,logName,(long long) execStatus->CurrentEvaluationDepth); PrintProcParamArray(theEnv,execStatus,logName); }
/********************************************************************** NAME : WatchGeneric DESCRIPTION : Prints out a trace of the beginning or end of the execution of a generic function INPUTS : A string to indicate beginning or end of execution RETURNS : Nothing useful SIDE EFFECTS : None NOTES : Uses the globals CurrentGeneric, ProcParamArraySize and ProcParamArray for other trace info **********************************************************************/ static void WatchGeneric( void *theEnv, const char *tstring) { EnvPrintRouter(theEnv,WTRACE,"GNC "); EnvPrintRouter(theEnv,WTRACE,tstring); EnvPrintRouter(theEnv,WTRACE," "); if (DefgenericData(theEnv)->CurrentGeneric->header.whichModule->theModule != ((struct defmodule *) EnvGetCurrentModule(theEnv))) { EnvPrintRouter(theEnv,WTRACE,EnvGetDefmoduleName(theEnv,(void *) DefgenericData(theEnv)->CurrentGeneric->header.whichModule->theModule)); EnvPrintRouter(theEnv,WTRACE,"::"); } EnvPrintRouter(theEnv,WTRACE,ValueToString((void *) DefgenericData(theEnv)->CurrentGeneric->header.name)); EnvPrintRouter(theEnv,WTRACE," "); EnvPrintRouter(theEnv,WTRACE," ED:"); PrintLongInteger(theEnv,WTRACE,(long long) EvaluationData(theEnv)->CurrentEvaluationDepth); PrintProcParamArray(theEnv,WTRACE); }