summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordoko <doko@6ca36cf4-e1d1-0310-8c6f-e303bb2178ca>2013-10-20 23:05:58 +0000
committerdoko <doko@6ca36cf4-e1d1-0310-8c6f-e303bb2178ca>2013-10-20 23:05:58 +0000
commit69d7026c8d33c9cfa5a90e8a050577bb3aa53f1f (patch)
tree1b5e08122516eb8677e2dd87fb998384dcb9b7f1
parent206767a6609a13221853b18ca7a66173838c9304 (diff)
downloadgcc-47-69d7026c8d33c9cfa5a90e8a050577bb3aa53f1f.tar.gz
* Make the libstdc++ pretty printers compatible with Python3, if
gdb is built with Python3 support. git-svn-id: svn://svn.debian.org/svn/gcccvs/branches/sid/gcc-4.7@6988 6ca36cf4-e1d1-0310-8c6f-e303bb2178ca
-rw-r--r--debian/changelog4
-rw-r--r--debian/patches/libstdc++-python3.diff167
-rw-r--r--debian/rules.patch5
3 files changed, 175 insertions, 1 deletions
diff --git a/debian/changelog b/debian/changelog
index 4cbf987..0bf8608 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,10 @@
-gcc-4.7 (4.7.3-7ubuntu1) UNRELEASED; urgency=low
+gcc-4.7 (4.7.3-8) unstable; urgency=low
* Update to SVN 20131020 (r203880) from the gcc-4_7-branch.
* Update the Linaro support to the 4.7-2013.10 release.
* Fix bootstrap of native aarch64 build.
+ * Make the libstdc++ pretty printers compatible with Python3, if
+ gdb is built with Python3 support.
-- Matthias Klose <doko@debian.org> Sun, 20 Oct 2013 23:08:56 +0200
diff --git a/debian/patches/libstdc++-python3.diff b/debian/patches/libstdc++-python3.diff
new file mode 100644
index 0000000..fc5989c
--- /dev/null
+++ b/debian/patches/libstdc++-python3.diff
@@ -0,0 +1,167 @@
+# DP: Make the libstdc++-v3 pretty printer compatible with Python3.
+
+--- a/src/libstdc++-v3/python/libstdcxx/v6/printers.py
++++ b/src/libstdc++-v3/python/libstdcxx/v6/printers.py
+@@ -42,7 +42,7 @@
+ # anything fancier here.
+ field = typ.fields()[0]
+ if not field.is_base_class:
+- raise ValueError, "Cannot find type %s::%s" % (str(orig), name)
++ raise ValueError("Cannot find type %s::%s" % (str(orig), name))
+ typ = field.type
+
+ class SharedPointerPrinter:
+@@ -86,7 +86,7 @@
+ def __iter__(self):
+ return self
+
+- def next(self):
++ def __next__(self):
+ if self.base == self.head:
+ raise StopIteration
+ elt = self.base.cast(self.nodetype).dereference()
+@@ -133,7 +133,7 @@
+ def __iter__(self):
+ return self
+
+- def next(self):
++ def __next__(self):
+ if self.base == 0:
+ raise StopIteration
+ elt = self.base.cast(self.nodetype).dereference()
+@@ -187,7 +187,7 @@
+ def __iter__(self):
+ return self
+
+- def next(self):
++ def __next__(self):
+ count = self.count
+ self.count = self.count + 1
+ if self.bitvec:
+@@ -265,20 +265,20 @@
+ # Set the actual head to the first pair.
+ self.head = self.head.cast (nodes[0].type)
+ elif len (nodes) != 0:
+- raise ValueError, "Top of tuple tree does not consist of a single node."
++ raise ValueError("Top of tuple tree does not consist of a single node.")
+ self.count = 0
+
+ def __iter__ (self):
+ return self
+
+- def next (self):
++ def __next__ (self):
+ nodes = self.head.type.fields ()
+ # Check for further recursions in the inheritance tree.
+ if len (nodes) == 0:
+ raise StopIteration
+ # Check that this iteration has an expected structure.
+ if len (nodes) != 2:
+- raise ValueError, "Cannot parse more than 2 nodes in a tuple tree."
++ raise ValueError("Cannot parse more than 2 nodes in a tuple tree.")
+
+ # - Left node is the next recursion parent.
+ # - Right node is the actual class contained in the tuple.
+@@ -342,7 +342,7 @@
+ def __len__(self):
+ return int (self.size)
+
+- def next(self):
++ def __next__(self):
+ if self.count == self.size:
+ raise StopIteration
+ result = self.node
+@@ -403,9 +403,9 @@
+ def __iter__(self):
+ return self
+
+- def next(self):
++ def __next__(self):
+ if self.count % 2 == 0:
+- n = self.rbiter.next()
++ n = next(self.rbiter)
+ n = n.cast(self.type).dereference()['_M_value_field']
+ self.pair = n
+ item = n['first']
+@@ -445,8 +445,8 @@
+ def __iter__(self):
+ return self
+
+- def next(self):
+- item = self.rbiter.next()
++ def __next__(self):
++ item = next(self.rbiter)
+ item = item.cast(self.type).dereference()['_M_value_field']
+ # FIXME: this is weird ... what to do?
+ # Maybe a 'set' display hint?
+@@ -523,7 +523,7 @@
+ def __iter__(self):
+ return self
+
+- def next(self):
++ def __next__(self):
+ if self.p == self.last:
+ raise StopIteration
+
+@@ -561,7 +561,7 @@
+
+ size = self.buffer_size * delta_n + delta_s + delta_e
+
+- return '%s with %d elements' % (self.typename, long (size))
++ return '%s with %d elements' % (self.typename, int (size))
+
+ def children(self):
+ start = self.val['_M_impl']['_M_start']
+@@ -616,7 +616,7 @@
+ def __iter__ (self):
+ return self
+
+- def next (self):
++ def __next__ (self):
+ if self.node == 0:
+ raise StopIteration
+ node = self.node.cast(self.node_type)
+@@ -639,8 +639,8 @@
+ return '[%d]' % i
+
+ def children (self):
+- counter = itertools.imap (self.format_count, itertools.count())
+- return itertools.izip (counter, Tr1HashtableIterator (self.val))
++ counter = map (self.format_count, itertools.count())
++ return zip (counter, Tr1HashtableIterator (self.val))
+
+ class Tr1UnorderedMapPrinter:
+ "Print a tr1::unordered_map"
+@@ -667,11 +667,11 @@
+ return '[%d]' % i
+
+ def children (self):
+- counter = itertools.imap (self.format_count, itertools.count())
++ counter = map (self.format_count, itertools.count())
+ # Map over the hash table and flatten the result.
+- data = self.flatten (itertools.imap (self.format_one, Tr1HashtableIterator (self.val)))
++ data = self.flatten (map (self.format_one, Tr1HashtableIterator (self.val)))
+ # Zip the two iterators together.
+- return itertools.izip (counter, data)
++ return zip (counter, data)
+
+ def display_hint (self):
+ return 'map'
+@@ -688,7 +688,7 @@
+ def __iter__(self):
+ return self
+
+- def next(self):
++ def __next__(self):
+ if self.base == 0:
+ raise StopIteration
+ elt = self.base.cast(self.nodetype).dereference()
+@@ -741,7 +741,7 @@
+ # A small sanity check.
+ # FIXME
+ if not self.compiled_rx.match(name + '<>'):
+- raise ValueError, 'libstdc++ programming error: "%s" does not match' % name
++ raise ValueError('libstdc++ programming error: "%s" does not match' % name)
+ printer = RxPrinter(name, function)
+ self.subprinters.append(printer)
+ self.lookup[name] = printer
diff --git a/debian/rules.patch b/debian/rules.patch
index 302004c..996a443 100644
--- a/debian/rules.patch
+++ b/debian/rules.patch
@@ -89,6 +89,11 @@ debian_patches += \
libgo-setcontext-config \
pr50043 \
+gdb_depends := $(shell dpkg -s gdb | grep '^Depends:.*libpython3')
+ifneq (,$(findstring libpython3,$(gdb_depends)))
+ debian_patches += libstdc++-python3
+endif
+
ifneq (,$(filter $(cloog_backend),ppl-0.11))
debian_patches += gcc-cloog-dl
endif