Ok, let's go about this a different way. Here is a stripped-down version of a much more complex C program, running on a Si Labs C8051F046: > > /* * * * * * * * */ > /* BEGIN t1.c */ > /* * * * * * * * */ > > unsigned char t1(unsigned char k); > > /* ========================== */ > /* main() routine */ > /* ========================== */ > > void main (void) { > unsigned char i, j; > > for(;;) { > for(i=0; i<3; i++) { > j = t1(i); > } /* Line 17 */ > i=0; /* Line 18 */ > } > } > > /* ========================== */ > /* void t1(unsigned char i) */ > /* ========================== */ > > unsigned char t1(unsigned char k) { > > return(k + 1); > } > /* * * * * * * * */ > /* END t1.c */ > /* * * * * * * * */ > At its essence, main() passes an argument, i, to function t1(). Then t1() performs some math on the parameter received and returns a value used by main(). This compiles, links, and produces predicted output with my Keil simulator, or running on the target hardware under Si Labs' debugger DLL. But the amount of data in the real problem is much too large to examine by hand, so I wish to automate the test process with a user function, as described in the Getting Started with uVision2, Users Guide 02.2001, p. 137 and assorted other places. Here's what I came up with, stored in script t1.ini: > > /* * * * * * * * */ > /* BEGIN t1.ini */ > /* * * * * * * * */ > > FUNC void t1a(void) { > > printf("%3d %3d\n", i, j); > } > > FUNC void t1b(void) { > > exec("log > t1.log"); > exec("bs \\TestClkVRef00\\17", 1, "t1a()"); > exec("bs \\TestClkVRef00\\18", 1, "_break_=1"); > exec("G"); > while(_break_!=1) > ; /* Wait until simulation stops */ > exec("log off"); > } > > /* * * * * * * * */ > /* END t1.ini */ > /* * * * * * * * */ > User function t1a() prints present values of automatics i & j, inside the "for(i=0; i<3; i++)" loop of main(). To have them in scope, I set a breakpoint on the 'close curly bracket' I have earmarked "Line 17" in a comment in the source file. This also works without a hitch. But I'm still dissatisfied with the amount of keyboarding I have to do, so I create function t1b() to automate it even more. Function t1b(): - Opens a log file (t1.log) to capture my output for later use; - Sets the breakpoint I earlier defined manually on line 17, to print the data. According to my User's Guide, if I attach a command to my breakpoint, the debugger/simulator only breaks long enough to execute that command, so I just call the previously-debugged user function t1a() here, to print my results; - Sets another breakpoint on line 18 (which is outside the "for(i=0; i<3; i++)" loop), at which point I know my test app is done, and I want to close the log file. - Issues a "GO" command; - According to earlier posts to this forum, this script will continue to run on my host workstation, independent of the execution/breakpoint behavior of my target hardware, so I tell it to monitor the _break_ system variable, which I know will be set to 1 when my target breaks on line 18 of the target app. - Terminates capture of output to the log file, so I can look at it; import it into Excel, etc. The trouble is, when I try to "include" this script into uVision3, it crashes in the second function, on the line that defines the first breakpoint: > > FUNC void t1a(void) { > > printf("%3d %3d\n", i, j); > } > > FUNC void t1b(void) { > > exec("log > t1.log"); > exec("bs \\TestClkVRef00\\17", 1, "t1a()"); > *** error 52, line 9: left side of '.' requires struct/union > . . . . so function t1b() never gets defined. - If you parse the diagnostic, it appears to take issue with a badly defined union or structure on my part. - If you examine my source file and script, you will find no attempts to define structures or unions. - In fact you will not even find a period or '->' in either place. I am stymied. Can anybody translate this to English? ============================================================ Gary Lynch | To send mail, change no$pam in lynchg@no$pam.com | my domain name to stacoenergy
"In fact you will not even find a period or '->' in either place." I think you will:
1> 2> FUNC void t1a(void) { 3> 4> printf("%3d %3d\n", i, j); 5> } 6> 7> FUNC void t1b(void) { 8> 9> exec("log > t1.log"); 10> exec("bs \\TestClkVRef00\\17", 1, "t1a()"); > *** error 52, line 9: left side of '.' requires struct/union >