gdb user defined routines and g++ 4x.

Ravi Menon jravimenon@gmail.com
Thu Jun 1 06:44:00 GMT 2006


Hi,

I am attaching some user-defined gdb routines to debug stl - slightly
modified to work with g++ 4.0.2  from the original g++ 3.4.3 (takes
into account the _M_impl member in various stl containers).

Everything works fine except 'dumpmap' and it looks like the symbol,
'_Rb_tree_node' is not 'visible' anymore in gdb - i.e. this line
fails:

p ((_Rb_tree_node*) $i)->_M_value_field

i.e. downcasting from _Rb_tree_node_base to _Rb_tree_node. I am fairly
certain this used to work in g++ 3.4.3. In 4.0.2, when I 'tab' for
_Rb_tree... in gdb, I only get:

(gdb) p _Rb_tree
_Rb_tree                 _Rb_tree_impl
_Rb_tree_const_iterator  _Rb_tree_iterator
(gdb) p std::_Rb_tree
_Rb_tree                 _Rb_tree_impl
_Rb_tree_const_iterator  _Rb_tree_iterator

I believe in 3.4.3 it used to 'somehow' make this instantiated type visible:

template<....>
class _Rb_tree
{
 .
 .
typedef _Rb_tree_node<_Val> _Rb_tree_node;
.
.

};

Any way to expose this '_Rb_tree_node' for gdb purposes in 4x?

Thanks,
Ravi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gdbinit4x
Type: application/octet-stream
Size: 1362 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20060601/db2fe0d1/attachment.obj>


More information about the Libstdc++ mailing list