summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordoko <doko@6ca36cf4-e1d1-0310-8c6f-e303bb2178ca>2013-10-21 12:02:38 +0000
committerdoko <doko@6ca36cf4-e1d1-0310-8c6f-e303bb2178ca>2013-10-21 12:02:38 +0000
commitdac4fe369d4fa7212fdaff81825e53f43efe91fc (patch)
treee74b7a6703c6020161d6297d65061724bc1ea7ac
parent69d7026c8d33c9cfa5a90e8a050577bb3aa53f1f (diff)
downloadgcc-47-dac4fe369d4fa7212fdaff81825e53f43efe91fc.tar.gz
* Fix loading of libstdc++ pretty printers. Addresses: #701935.
git-svn-id: svn://svn.debian.org/svn/gcccvs/branches/sid/gcc-4.7@6989 6ca36cf4-e1d1-0310-8c6f-e303bb2178ca
-rw-r--r--debian/changelog3
-rw-r--r--debian/patches/gcc-multiarch.diff17
-rw-r--r--debian/rules.d/binary-libstdcxx.mk4
3 files changed, 20 insertions, 4 deletions
diff --git a/debian/changelog b/debian/changelog
index 0bf8608..e3a5bef 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,8 +5,9 @@ gcc-4.7 (4.7.3-8) unstable; urgency=low
* Fix bootstrap of native aarch64 build.
* Make the libstdc++ pretty printers compatible with Python3, if
gdb is built with Python3 support.
+ * Fix loading of libstdc++ pretty printers. Addresses: #701935.
- -- Matthias Klose <doko@debian.org> Sun, 20 Oct 2013 23:08:56 +0200
+ -- Matthias Klose <doko@debian.org> Mon, 21 Oct 2013 14:02:04 +0200
gcc-4.7 (4.7.3-7) unstable; urgency=low
diff --git a/debian/patches/gcc-multiarch.diff b/debian/patches/gcc-multiarch.diff
index 3e28b71..31e30d3 100644
--- a/debian/patches/gcc-multiarch.diff
+++ b/debian/patches/gcc-multiarch.diff
@@ -4,7 +4,7 @@ Index: b/src/libstdc++-v3/python/hook.in
===================================================================
--- a/src/libstdc++-v3/python/hook.in
+++ b/src/libstdc++-v3/python/hook.in
-@@ -47,7 +47,10 @@
+@@ -47,14 +47,18 @@
libdir = libdir[len (prefix):]
# Compute the ".."s needed to get from libdir to the prefix.
@@ -16,6 +16,17 @@ Index: b/src/libstdc++-v3/python/hook.in
objfile = gdb.current_objfile ().filename
dir_ = os.path.join (os.path.dirname (objfile), dotdots, pythondir)
+
+- if not dir_ in sys.path:
++ if not objfile.startswith('/usr/lib/debug/') and not dir_ in sys.path:
+ sys.path.insert(0, dir_)
+
+ # Load the pretty-printers.
+-from libstdcxx.v6.printers import register_libstdcxx_printers
+-register_libstdcxx_printers (gdb.current_objfile ())
++if gdb.current_objfile () is None or not gdb.current_objfile ().filename.startswith ('/usr/lib/debug/'):
++ from libstdcxx.v6.printers import register_libstdcxx_printers
++ register_libstdcxx_printers (gdb.current_objfile ())
Index: b/src/gcc/config/sh/t-linux
===================================================================
--- a/src/gcc/config/sh/t-linux
@@ -42,7 +53,7 @@ Index: b/src/gcc/config.gcc
===================================================================
--- a/src/gcc/config.gcc
+++ b/src/gcc/config.gcc
-@@ -1829,6 +1829,8 @@
+@@ -1828,6 +1828,8 @@
if test x$enable_targets = xall; then
tm_file="${tm_file} mips/gnu-user64.h mips/linux64.h"
tmake_file="${tmake_file} mips/t-linux64"
@@ -51,7 +62,7 @@ Index: b/src/gcc/config.gcc
fi
case ${target} in
mipsisa32r2*)
-@@ -2228,6 +2235,8 @@
+@@ -2227,6 +2229,8 @@
tm_file="s390/s390.h dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h s390/linux.h"
if test x$enable_targets = xall; then
tmake_file="${tmake_file} s390/t-linux64"
diff --git a/debian/rules.d/binary-libstdcxx.mk b/debian/rules.d/binary-libstdcxx.mk
index 6ef0332..ba3ee08 100644
--- a/debian/rules.d/binary-libstdcxx.mk
+++ b/debian/rules.d/binary-libstdcxx.mk
@@ -223,6 +223,8 @@ define __do_libstdcxx_dbg
cp -p $(d)/$(usr_lib$(2))/libstdc++.so.*.py \
$(d_d)/$(PF)/lib/debug/$(usr_lib$(2))/.;
+ sed -i -e "/^libdir *=/s,=.*,= '/$(usr_lib$(2))'," \
+ $(d_d)/$(PF)/lib/debug/$(usr_lib$(2))/libstdc++.so.*.py
$(if $(filter yes,$(with_lib$(2)cxx)),
cp -a $(d)/$(usr_lib$(2))/libstdc++.so.*[0-9] \
$(d_d)/$(usr_lib$(2))/.;
@@ -418,6 +420,8 @@ endif
cp -p $(d)/$(usr_lib)/libstdc++.so.*.py \
$(d_dbg)/$(PF)/lib/debug/$(usr_lib)/
+ sed -i -e "/^libdir *=/s,=.*,= '/$(usr_lib)'," \
+ $(d_dbg)/$(PF)/lib/debug/$(usr_lib)/libstdc++.so.*.py
ifeq ($(with_libcxx),yes)
cp -a $(d)/$(usr_lib)/libstdc++.so.*[0-9] \
$(d_dbg)/$(usr_lib)/