libstdc++ debug script sets wrong PYTHONPATH

Bug #1255573 reported by Bruce Merry
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
gcc-4.8 (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

libstdc++6-4.8-dbg on installs /usr/lib/debug/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.18-gdb.py. This is supposed to autoload the pretty-printers for libstdc++ into gdb when a program is started. However, its logic for determining the path to set seems to be broken, because it leads to this error in gdb:

Traceback (most recent call last):
  File "/usr/lib/debug/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.18-gdb.py", line 60, in <module>
    from libstdcxx.v6.printers import register_libstdcxx_printers
ImportError: No module named 'libstdcxx'
DIR = /usr/lib/x86_64-linux-gnu/../share/gcc-4.8/python
Traceback (most recent call last):
  File "/usr/lib/debug/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.18-gdb.py", line 60, in <module>
    from libstdcxx.v6.printers import register_libstdcxx_printers
ImportError: No module named 'libstdcxx'

And STL containers are not pretty-printed. Manually adding /usr/share/gcc-4.8/python to the PYTHONPATH (e.g. by writing Python code in .gdbinit) fixes the problem.

I am running Ubuntu 13.10 on x86_64. I've also noticed the problem on 13.04 with libstdc++6-4.7-dbg.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gcc-4.8 (Ubuntu):
status: New → Confirmed
Revision history for this message
kajokeji (kajokeji-2013) wrote :

In file /usr/lib/debug/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19-gdb.py (from trusty ,
I may suggest changing the line:
backdirs = len (libdir.split (os.sep))
by
backdirs = len (libdir.split (os.sep))-1

Revision history for this message
Bruce Merry (bmerry) wrote :

Also affects Trusty Tahr beta (libstdc++6-4.8-dbg 4.8.2-16ubuntu6).

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.