Re: debugging




Bill Pursell skrev:

Sheldon wrote:

I would like to view the contents of structure as part of a debugging
routine.
<snip>
To summerize: I am wondering if there is a way to view a structure like
in python: print list and to comfirm my suspicion about the memcpy to
the pointer.

Write a function to print the structure. eg:
void pretty_print (struct foo *f)
{
printf("a=%d\t b=%d\nc=%d\tc=%d\n", f->a, f->b, f->c, f->c);
}

Now, in your debugger, make a call to the function.

--
Bill Pursell

This would work if I had simple scalars in the structure but there are
arrays and strings as well as integers/floats. I just would like to
know what are the names of the variables in the structure and perhaps
the variable types.

/Sheldon

.


Quantcast