Re: tracking execution
Posted in 1992
I think this may be what you're looking for... -Rich ------- The following is in our project's master .h file: (Note that *every* module in the project does OssTrace("thismodulename"); as the first line of executable code in the module [where thismodulename is, of course, the individual module name...should someone forget to do this in a new module, then the "(unknown)" declaration in WriteOssLog.c will be used].) /* * OssTrace will eventually be defined to not only declare a static variable * containing the name of the function, but call WriteOssLog if we are * tracing. */ extern char __exec_start[], __exec_end[], __ossname[]; #define OssTrace(x) static char __ossname[] = x; \\ if (oss_trace||oss_debug) { WriteOssLog(ERR_TRACE, __exec_start); \\ __osstrace(__ossname, __FILE__); } /* * WriteOssLog passes the name of the function, obtained from OssTrace. * If not defined in the current function, it will pick up the one defined * in WriteOssLog itself, which will be empty. */ #define WriteOssLog(i, m) _WriteOssLog(__ossname, __FILE__, __LINE__, i, m) WriteOssLog.c contains the following global declarations: char __exec_start[] = "Starting execution"; char __exec_end[] = "Ending execution"; char __ossname[] = "(unknown)"; The following is a typical call to WriteOssLog(): if ( status == ABEND ) { /*:DON Error:*/ UpdateMsg(ABEND, &LVT); sprintf(msg, don_error, MG_DON); WriteOssLog(ERR_MISC, msg); return(ULMainReturn(&LVT, rep_req_flag, &original_a0)); }