how to print vector<bool> value in gdb?

H

huomingxu

in gdb, when print an element of vector<bool>, it returns the offset of
the bi
t
instead of the value.
e.g: (visible is of type vector<bool>)
(gdb) p layout._visible[3]
$15 = {_M_p = 0x9817d00, _M_mask = 8}
(gdb) p layout._visible[3] & 0x80
Structure has no component named operator&.
(gdb)


How to display its real value?

No such problem when debugging on VC
thanks a lot
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top