ARM Technical Support Knowledge Articles

ARGUMENT INVALID WHEN USING DEBUGGER FUNCT

Applies to: uVision Debugger

Answer


Information in this article applies to:


QUESTION

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

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

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

FUNC void string(void)
{
printf (" %s
",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

Article last edited on: 2004-06-29 10:26:07

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential