From 9135268039c746f15fc83dffb571d0345b231abc Mon Sep 17 00:00:00 2001 From: tromey Date: Mon, 15 Jun 2009 20:54:22 +0000 Subject: * python/libstdcxx/v6/printers.py (StdMapPrinter.__init__): Don't set self.iter. (StdMapPrinter.to_string): Make a new iterator. (StdMapPrinter.children): Likewise. (StdSetPrinter.__init__): Don't set self.iter. (StdSetPrinter.to_string): Make a new iterator. (StdSetPrinter.children): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@148506 138bc75d-0d04-0410-961f-82ee72b054a4 --- libstdc++-v3/python/libstdcxx/v6/printers.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'libstdc++-v3/python') diff --git a/libstdc++-v3/python/libstdcxx/v6/printers.py b/libstdc++-v3/python/libstdcxx/v6/printers.py index 4dddd8f60f9..e2bb231e15a 100644 --- a/libstdc++-v3/python/libstdcxx/v6/printers.py +++ b/libstdc++-v3/python/libstdcxx/v6/printers.py @@ -277,17 +277,17 @@ class StdMapPrinter: def __init__ (self, typename, val): self.typename = typename self.val = val - self.iter = RbtreeIterator (val) def to_string (self): - return '%s with %d elements' % (self.typename, len (self.iter)) + return '%s with %d elements' % (self.typename, + len (RbtreeIterator (self.val))) def children (self): keytype = self.val.type.template_argument(0).const() valuetype = self.val.type.template_argument(1) nodetype = gdb.lookup_type('std::_Rb_tree_node< std::pair< %s, %s > >' % (keytype, valuetype)) nodetype = nodetype.pointer() - return self._iter (self.iter, nodetype) + return self._iter (RbtreeIterator (self.val), nodetype) def display_hint (self): return 'map' @@ -317,15 +317,15 @@ class StdSetPrinter: def __init__ (self, typename, val): self.typename = typename self.val = val - self.iter = RbtreeIterator (val) def to_string (self): - return '%s with %d elements' % (self.typename, len (self.iter)) + return '%s with %d elements' % (self.typename, + len (RbtreeIterator (self.val))) def children (self): keytype = self.val.type.template_argument(0) nodetype = gdb.lookup_type('std::_Rb_tree_node< %s >' % keytype).pointer() - return self._iter (self.iter, nodetype) + return self._iter (RbtreeIterator (self.val), nodetype) class StdBitsetPrinter: "Print a std::bitset" -- cgit v1.2.1