diff options
author | Tom Tromey <tromey@redhat.com> | 2009-06-15 20:54:22 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2009-06-15 20:54:22 +0000 |
commit | ee47095bb498f373c43e6063bdaee95c73a73106 (patch) | |
tree | a3f1a03f92afe861f4754c06779b71ca16f21e64 | |
parent | 98a129b9c42c43d4cc0a256963482df85bb43284 (diff) | |
download | gcc-ee47095bb498f373c43e6063bdaee95c73a73106.zip gcc-ee47095bb498f373c43e6063bdaee95c73a73106.tar.gz gcc-ee47095bb498f373c43e6063bdaee95c73a73106.tar.bz2 |
printers.py (StdMapPrinter.__init__): Don't set self.iter.
* 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.
From-SVN: r148506
-rw-r--r-- | libstdc++-v3/ChangeLog | 10 | ||||
-rw-r--r-- | libstdc++-v3/python/libstdcxx/v6/printers.py | 12 |
2 files changed, 16 insertions, 6 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 4173c75..2ca72ea 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,13 @@ +2009-06-15 Tom Tromey <tromey@redhat.com> + + * 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. + 2009-06-11 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/random.tcc diff --git a/libstdc++-v3/python/libstdcxx/v6/printers.py b/libstdc++-v3/python/libstdcxx/v6/printers.py index 4dddd8f..e2bb231 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" |