User forums > Using Code::Blocks
When debugging how to see structure member value
(1/1)
typicalc:
The watch -window shows structure pointer hex address values, I'd like to see the structure members also.
For example in my code I have:
void somefunc(struct address *test)
{
..
}
When debugging what goes on in "somefunc" I'd like to see what in test->street and test->name etc. I can enter each watch member but that is cumbersome. Is tehre an easier way?
oBFusCATed:
Write click on the watch and there is a menu item in the context menu that replaces the variable with its dereferenced value. It turns test into *test.
You can also manually enter dereferenced variables.
raynebc:
The only downside of showing an entire structure in the watch window (and this is minor of course) is that you can't control the displayed format of each member variable.
typicalc:
Thanks.
The watch window already had the local item "test", but clicking it procudes no ".." button. However entering "test" as a new watch item and clicking that got what I wanted.
oBFusCATed:
The "..." button is not what you want. :)
Enter *test and you'll see a lot better output. :)
Navigation
[0] Message Index
Go to full version