QtCreator 2.8.1 local & expressions problem with gdb/python version while debugging
-
Hello, last days I did the step from Qt4.8 to 5.1.1 for my embedded software projects. I did install the newest version of QtCreator (2.8.1) and Qt (5.1.1) on a fresh Ubuntu 13.10 (Saucy Salamander) 32bit.
Compiling my apps wokred fine. But debugging the apps does work. After stopping at breakpoints no locals and expressions were shown.I did open the debugger log window a got some error messages like these
@>&"Undefined command: "bb". Try "help".\n"
27^error,msg="Undefined command: \\"bb". Try "help"."
dDUMPER FAILED: 27^error,data={msg="Undefined command: \\"bb". Try "help"."}&"NameError: name 'execfile' is not defined\n"
&"Error while executing Python code.\n"
22^error,msg="Error while executing Python code."@The last one directs me in the right direction execfile is no langer supported by python 3 which is used for parsing the gdb messages in QtCeator.
So I add the following line to the debug startup commands to print out the python version (by using exec istead execfile) and gotcha it shows me version3.3.2 for python
@>&"python exec(open('/home/user/showVersion.py').read())\n"
~"3.3.2\n@
My showVersion.py simply calls the python version
@import sys
sys.stdout.write('%s.%s.%s\n' % sys.version_info[0:3])@
The strange thing is that on the system Python 2.7 and Python 3.3 are installed and the current python version which is reachable by the PATH and links is 2.7.5. Buzt from QtCreator version 3.3.2 is used
@
user@untunu13.10:~$ python --version
Python 2.7.5+@At the end I found out that it depends from the gdb which is linked against libpython3.3m.so.1.0
@user@ubuntu13.10:~$ ldd /usr/bin/gdb
linux-gate.so.1 => (0xb76ed000)
libreadline.so.6 => /lib/i386-linux-gnu/libreadline.so.6 (0xb7699000)
libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xb7694000)
libncurses.so.5 => /lib/i386-linux-gnu/libncurses.so.5 (0xb766e000)
libtinfo.so.5 => /lib/i386-linux-gnu/libtinfo.so.5 (0xb764c000)
libz.so.1 => /lib/i386-linux-gnu/libz.so.1 (0xb7632000)
libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xb75ef000)
libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xb75d4000)
libpython3.3m.so.1.0 => /usr/lib/i386-linux-gnu/libpython3.3m.so.1.0 (0xb720e000)
libexpat.so.1 => /lib/i386-linux-gnu/libexpat.so.1 (0xb71e5000)
liblzma.so.5 => /lib/i386-linux-gnu/liblzma.so.5 (0xb71be000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb700a000)
/lib/ld-linux.so.2 (0xb76ee000)
libutil.so.1 => /lib/i386-linux-gnu/libutil.so.1 (0xb7006000)@I did a new a new fresh installation on a Mint 15 32bit system and check the gdb dependencies which show me that the gdb is linked against libpython2.7.so.1.0
@user@mint15 ~ $ ldd /usr/bin/gdb
linux-gate.so.1 => (0xb77bd000)
libreadline.so.6 => /lib/i386-linux-gnu/libreadline.so.6 (0xb776c000)
libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xb7767000)
libncurses.so.5 => /lib/i386-linux-gnu/libncurses.so.5 (0xb7744000)
libtinfo.so.5 => /lib/i386-linux-gnu/libtinfo.so.5 (0xb7725000)
libz.so.1 => /lib/i386-linux-gnu/libz.so.1 (0xb770c000)
libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xb76c9000)
libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xb76ae000)
libpython2.7.so.1.0 => /usr/lib/i386-linux-gnu/libpython2.7.so.1.0 (0xb73b1000)
libexpat.so.1 => /lib/i386-linux-gnu/libexpat.so.1 (0xb7389000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb71d6000)
/lib/ld-linux.so.2 (0xb77be000)
libutil.so.1 => /lib/i386-linux-gnu/libutil.so.1 (0xb71d2000)@I gave the newest QtCreator another chance and like guessed it works. So the result ist that QtCreator likes to use python commands which are different between version 2.7 and 3.3 or does not exists in version 3.3.
By sure you can compile your own gdb with python 2.7 support but there should be a more comfortable to get the debugging up and running for everybody without digging in the dependencies of executed gdb binaries.
Or at least there should be a message that Python 2.7 binding in gdb is required and QtCreator can't work without them. No nice but you know why the local & expressions are not available :-(.Best regards Michael
-
Thank you, it works!
-
@kuschky: Quite a few Python commands are different between version 2 and 3 and GDB was built and used all over the place with Python 2 (only). If it had been expected that Ubuntu 13.10 shipped a Python 3 based GDB the problem would not have occured. Qt Creator 3.0 can now handle GDB builds with either Python 2 or Python 3, but one cannot go back in time and change the 2.8.1 release in August to handle distribution changes that will occur several weeks later.