Technical Support

µVISION DEBUGGER: ARGUMENT INVALID WHEN USING DEBUGGER FUNCT


Information in this article applies to:

  • µVision Version 2.05

QUESTION

I'm having trouble using debugger functions with printf. In my C program, I create a global string:

char tststring[25] ={"Test string\0"};

In the debugger, I create a debug function to print this string:

FUNC void string(void)
{
printf (" %s\n",tststring);
}

The debugger gives me the following error message:

printf: argument 2 invalid

What's wrong with my debug function?

ANSWER

You cannot use variables from your C program in debug functions that way. Additionally, debug functions do not support structures, arrays, or pointers. A C string is an array of characters, so it isn't supported.

MORE INFORMATION

  • Refer to page 283, Differences Between dScope Functions and ANSI C, in the dScope for Windows User's Guide, 01.97 for more information.

Last Reviewed: Tuesday, June 29, 2004


Did this article provide the answer you needed?
 
Yes
No
Not Sure