Package: libstdc++6-4.8-dbg Version: 4.8.1-2 Followup-For: Bug #701935 Dear Maintainer,
The following patch fixes the issue for me. Actually, there are two bugs: one that prevents printers from working at all, and one that gives a false error message. The first part is obviously debian-specific, but should maybe be fixed in another part of the build process. I thought I'd sent a fix for this earlier, but maybe I'd just edited the file locally. Oddly, I can't find the relevant file in libstdc++6-4.{6,7}-dbg ... but it is in the 32-bit ones The second part should be upstreamed in some form or another. My patch is optimized for making the diff small, rather than for making the code pretty. The core problem here is that the pretty printers file gets loaded twice - first for the split debug info, and then for the actual shared object. -- System Information: Debian Release: jessie/sid APT prefers testing APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 3.2.0-4-amd64 (SMP w/2 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Versions of packages libstdc++6-4.8-dbg:amd64 depends on: ii gcc-4.8-base 4.8.1-2 ii libc6 2.17-7 ii libgcc1 1:4.8.1-2 ii libgcc1-dbg 1:4.8.1-2 ii libstdc++6 4.8.1-2 Versions of packages libstdc++6-4.8-dbg:amd64 recommends: ii libstdc++-4.8-dev 4.8.1-2 libstdc++6-4.8-dbg:amd64 suggests no packages. -- no debconf information
--- /usr/lib/debug/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.18-gdb.py 2013-06-04 10:44:56.000000000 -0700 +++ /usr/lib/debug/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.18-gdb.pyworking 2013-07-24 16:09:12.000000000 -0700 @@ -20,7 +20,7 @@ import os.path pythondir = '/usr/share/gcc-4.8/python' -libdir = '/usr/lib/../lib' +libdir = '/usr/lib/../lib/x86_64-linux-gnu' # This file might be loaded when there is no current objfile. This # can happen if the user loads it manually. In this case we don't @@ -48,13 +48,14 @@ # Compute the ".."s needed to get from libdir to the prefix. dotdots = ('..' + os.sep) * len (libdir.split (os.sep)) - + 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 ())