News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

When debugging how to see structure member value

Started by typicalc, May 16, 2016, 10:17:58 PM

Previous topic - Next topic

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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

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. :)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]