This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
[PATCH] Make StdVectorPrinter in printers.py compatible with ddd
- From: Hans Erickson <hans dot p dot erickson at gmail dot com>
- To: libstdc++ at gcc dot gnu dot org
- Date: Thu, 24 Mar 2011 12:51:17 -0500
- Subject: [PATCH] Make StdVectorPrinter in printers.py compatible with ddd
The current version of to_string in StdVectorPrinter uses an embedded
comma, which messes up the parsing done by ddd, and maybe other gdb
front-ends as well.? This patch changes the format so that ddd can
parse it.
- Hans Erickson
hans.p.erickson@gmail.com
Index: python/libstdcxx/v6/printers.py
===================================================================
--- python/libstdcxx/v6/printers.py (revision 171421)
+++ python/libstdcxx/v6/printers.py (working copy)
@@ -223,10 +223,10 @@
bl = 8 * itype.sizeof
length = (bl - so) + bl * ((finish - start) - 1) + fo
capacity = bl * (end - start)
- return ('%s<bool> of length %d, capacity %d'
+ return ('%s<bool> of length %d (capacity %d)'
% (self.typename, int (length), int (capacity)))
else:
- return ('%s of length %d, capacity %d'
+ return ('%s of length %d (capacity %d)'
% (self.typename, int (finish - start), int (end - start)))
def display_hint(self):
Index: ChangeLog
===================================================================
--- ChangeLog (revision 171421)
+++ ChangeLog (working copy)
@@ -1,3 +1,8 @@
+2011-03-24 Hans Erickson <hans.p.erickson@gmail.com>
+
+ * python/libstdcxx/v6/printers.py: Make StdVectorPrinter
+ pretty-printing compatible with ddd.
+
2011-03-24 Paolo Carlini <paolo.carlini@oracle.com>
* include/bits/random.h (negative_binomial_distribution<>::