Debugger: unable to see values of my variables
This is what I see when using the debugger:
Why can't I see the actual values? (I assume it's a setting, but I haven't开发者_如何学运维 a clue what it would be).
You can see the actual values. errmsg
is 0x0, data
is 0x1d254, and so on. What you can't see right now is the summary, which usually shows you the contents of the object being pointed to. Sometimes this happens because the debugger is a little confused; sometimes it's because the variables really are out of scope. If you have any optimizations turned on, the compiler may be eliminating the variable in question. One clue here is that both data
and typename
have the same value, so at least one of those isn't valid at this point in the code.
If the debugger is just confused, one way to see the object is to use the gdb console. gdb has a print-object
command, abbreviated po
, that's very useful:
> po data
will do its best to print a useful value.
精彩评论