gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Coding > Debugging functions with variable number of parameters

#102486 - vitalhb - Thu Sep 14, 2006 1:21 pm

Hello all,

I am trying to debug a function as described above but Insight (v. 6.5.50) is not able do show correctly the value of any local variable. This function was based on the "lpc2000_debug_printf" function of EFSL. I have added functionality to display fixed point numbers. My function is something like this:

void Fly_sprintf(char *s, const char *format, ...)
{
// local vars
va_list ap;
...

// Function body
va_start (ap, format);
}

I have circumvented this problem making global the local variables during debug. I just moved the function declaration below the local variables declarations:

//void Fly_sprintf(char *s, const char *format, ...)
//{
// local vars
va_list ap;
...

void Fly_sprintf(char *s, const char *format, ...)
{
// Function body
va_start (ap, format);
}

Although this way works, I would prefer to debug the code without modifications.
Has anyone had this problem? Any clue to solve it?

thanks in advance,
Vital