summaryrefslogtreecommitdiff
path: root/libstdc++-v3/python/libstdcxx/v6/printers.py
diff options
context:
space:
mode:
Diffstat (limited to 'libstdc++-v3/python/libstdcxx/v6/printers.py')
-rw-r--r--libstdc++-v3/python/libstdcxx/v6/printers.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/libstdc++-v3/python/libstdcxx/v6/printers.py b/libstdc++-v3/python/libstdcxx/v6/printers.py
index 5a414c59a7..5214c7d635 100644
--- a/libstdc++-v3/python/libstdcxx/v6/printers.py
+++ b/libstdc++-v3/python/libstdcxx/v6/printers.py
@@ -456,11 +456,12 @@ class StdRbtreeIteratorPrinter:
def __init__ (self, typename, val):
self.val = val
+ valtype = self.val.type.template_argument(0).strip_typedefs()
+ nodetype = gdb.lookup_type('std::_Rb_tree_node<' + str(valtype) + '>')
+ self.link_type = nodetype.strip_typedefs().pointer()
def to_string (self):
- typename = str(self.val.type.strip_typedefs()) + '::_Link_type'
- nodetype = gdb.lookup_type(typename).strip_typedefs()
- node = self.val.cast(nodetype).dereference()
+ node = self.val['_M_node'].cast(self.link_type).dereference()
return get_value_from_Rb_tree_node(node)
class StdDebugIteratorPrinter: