Debugger does not start. GDB not support Python scripting.
-
Hi
I have just upgraded to Qt Creator 5.3
When I try to run the debugger I get the message box
"The selected build of GDB does not support Python scripting it cannot be used in Qt Creator"
And no debugging happens.
When I run the auto detected GDBs in Options | Build & Run I get below.(Ubuntu 14.04) I get the following results.
$ gdb version
GNU gdb (GDB) 7.7
...$ python --version
Python 2.7.6
...Before I upgraded, debugging could happen, but local variable informatino was not very good.
Thanks for anyhelp
-
What does gdb says if you run python inside it.
@
(gdb) python print("Hello, world!")
Hello, world!
(gdb)
@ -
I guess you need to check python version. On Ubuntu 14.04 I have
(gdb) python import sys; print (sys.version)
3.4.0 (default, Apr 11 2014, 13:08:54)
[GCC 4.8.2]
(gdb)And I have both 2.7 and 3.4 python installed.
$ python --version
Python 2.7.6$ python3 --version
Python 3.4.0 -
Ah!
I get
(gdb) python print("Hello world!")
Python scripting is not supported in this copy of GDB.
(gdb) -
The latest version of QtCreator does not support gdb without python, so you need to install Ubuntu package or build gdb with python support
Here is how it looks like on Ubuntu 14.04
@
$ gdb --version
GNU gdb (Ubuntu 7.7-0ubuntu3.1) 7.7
@ -
Thanks, inspired by http://blog.hostilefork.com/qtcreator-debugger-no-locals-ubuntu/
I dowloaded gdb 7.7.1 from http://ftp.gnu.org/gnu/gdb/
I then run form gdb-7.7.1 directory(not sure whether configure options needed)
./configure --prefix /usr/local/gdb-python2 --with-python
make
make installI then created a new debugger link in Tools | Options | Build & Run, Debugger manual section pointing to /usr/local/gdb-python2/bin/gdb, and a new kit in Kits Manual section using that link.
It seems to be able to debug now.
-
For debian stretch users:
sudo apt-get install gdb-python2
-
Under Kubuntu 16.04 and Qt creator 4.4.1, uses udo apt-get install gdb python2.7-dbg
-
Check gdb packet, on my system (Kali Linux) by default was installed "gdb-minimal". Replase it by full "gdb" packet with include python support.
-
@Sriep I am using below configuration
Ubuntu 16 Qt 3.5.1 and I want to debug an application to raspberry pi from Host PC.
I am able to run the application in release mode to Rpi. I tried same solutions and able to install the gdb-7.7.1 and installed it and configuring it.. But I am still receiving the below errors.
Debugging starts
Listening on port 10005
Remote debugging from host 192.168.0.108
Process /home/pi/appchooser/build-appchooser-RaspberryPi-Debug/appchooser created; pid = 6518
Build ID mismatch between current exec-file /home/sruhad/QtSample/QtSample/build-appchooser-LocalPC-Debug/appchooser
and automatically determined exec-file loading /home/pi/appchooser/build-appchooser-RaspberryPi-Debug/appchooser /home/pi/appchooser/build-appchooser-RaspberryPi-Debug/appchooser: Not a directory.
while parsing target description (at line 10): Target description specified unknown architecture "arm"
Could not load XML target description; ignoring
Killing process(es): 6518
Debugging has finishedDebugging log:
&"warning: while parsing target description (at line 10): Target description specified unknown architecture "arm"\n"
while parsing target description (at line 10): Target description specified unknown architecture "arm"&"warning: Could not load XML target description; ignoring\n"
Could not load XML target description; ignoring
208^error,msg="Remote 'g' packet reply is too long (expected 312 bytes, got 328 bytes): 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0fdff7e0000000030eafc76100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
dRemote 'g' packet reply is too long (expected 312 bytes, got 328 bytes): 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0fdff7e0000000030eafc76100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000I know its very old post. But any help would be appreciated.