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

Paolo Carlini pcarlini@suse.de
Mon Jan 19 11:10:00 GMT 2004


Hi again,

in basic_string.h:

   *  The reason you want _M_data pointing to the character array and
   *  not the _Rep is so that the debugger can see the string
   *  contents. (Probably we should add a non-inline member to get
   *  the _Rep for the debugger to use, so users can check the actual
   *  string length.)

Now, if I do, with gdb6.0 (from DDD):

(gdb) p str
$1 = {static npos = 4294967295, _M_dataplus = {<allocator<char>> = {<No 
data fields>}, _M_p = 0x400f78dc ""}}

therefore, it looks like current gdbs is able to look inside
_M_dataplus (struct _Alloc_hider) and display _M_p directly...

Comments? Possible implications?

Thanks!
Paolo.



More information about the Libstdc++ mailing list