| |||||
Technical Support Support Resources
Product Information | µVISION DEBUGGER: DATE AND TIME OF TARGET ROUTINESInformation in this article applies to:
QUESTIONIs there a way to display the date and time a function was written in the µVision Debugger? ANSWERYes. There are numerous ways to associate the date and time with a routine. All you must do is include a date string variable and a time string variable in the function. When debugging, you can read and output these strings. The __DATE__ and __TIME__ compiler macros automatically generate strings with the DATE and TIME the program was compiled. So, they are convenient to use for this example.
Besides the changes to your program, a debugger function that outputs the date and time is required. The following debugger function:
func void Time_Stamp (long DateAddr, long TimeAddr ){
long addr;
printf(" ===============================================================\n");
printf(" Date: ");
for (addr = DateAddr; _rbyte(addr) != 0; addr++)
printf ("%c", _rbyte(addr));
printf("\n");
printf(" Time: ");
for (addr = TimeAddr; _rbyte(addr) != 0; addr++)
printf ("%c", _rbyte(addr));
printf("\n");
printf(" =================================================================\n");
}
may be copied into a debugger initialization file and added to Initialization File in the Options for Target - Debug dialog box. This debugger function requires that you pass the address of the DATE and TIME strings. Date and Time strings for specific functions may be accessed using a complete reference:
So, to display the DATE and TIME for the foo function in the BAR.C source file, enter the following command: Time_Stamp (\bar\foo\DateString, \bar\foo\TimeString) on the µVision Debugger command line. You may add ToolBox buttons to display the time and date for the functions you wish. For example: define button "Main Time" , "printf (\"\\n\\n main:\\n\"); Time_Stamp (\\main\\main\\DateString,\\main\\main\\TimeString)" Note that the above must be entered on a single line. SEE ALSO
FORUM THREADSThe following Discussion Forum threads may provide information related to this topic. Last Reviewed: Monday, June 26, 2006 | ||||
| |||||