This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] Another comment that... needs a comment! ;)


Nathan Myers wrote:

You can look at the string contents easily in gdb, but it is not
so easy to see the length, capacity, or refcount.  In fact, I have
not yet discovered the right way to get gdb 6 to display them at
all.

Well, length and capacity seem easy:

(gdb) p str._M_rep()->_M_length
$5 = 0
(gdb) p str._M_rep()->_M_capacity
$6 = 0

or "even":

(gdb) p str.size()
$8 = 0
(gdb) p str.capacity()
$9 = 0

I'm still battling with _M_references, tough ;)

Paolo.

P.S. -O0, -g.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]