8

I'm using Qt Creator with Qt 5.1.1 in Ubuntu 12.04. When I'm using the debugger to show content of any variable, the window always show "no such value" on every variable. Also on variables of type QString, int etc. Is there a configuration problem on my Ubuntu? Can anybody help me please?

Simon Warta
  • 10,850
  • 5
  • 40
  • 78
user2764107
  • 81
  • 1
  • 4

1 Answers1

3

It's been a year and a half ago, but the problem still remains actual for Ubuntu 12.04, Qt Creator 3.4.0 based on Qt 5.4.1.

As mentioned in Qt Creator Manual

Starting with version 3.1, Qt Creator requires the Python scripting extension. GDB builds without Python scripting are not supported anymore and will not work. The minimal supported version is GDB 7.5 using Python version 2.7, or 3.3, or newer.

I suppose that gdb --version gives you 7.4 (the last version of gdb for Ubuntu 12.04). That's why you have no such value issue.

1. Install a fresh gdb (7.8)

Remove the current gdb (to avoid conflicts with new one) and install development packet for python (to build gdb with Python scripting)

sudo apt-get remove gdb
sudo apt-get install python2.7-dev

Install gdb from the sources

wget http://ftp.gnu.org/gnu/gdb/gdb-7.8.tar.xz
tar -xf gdb-7.8.tar.xz     
cd gdb-7.8/     
./configure --prefix=/usr/local --with-python
make
sudo make install

Now gdb 7.8 is in /usr/local.

2. Update Qt Creator settings

  • Open menu Tools > Options ...
  • Select Build&Run, tab Debuggers
  • Click Add
  • Type Name you like, write Path: /usr/local/bin/gdb

  • In tab Kits change Debugger: with that you just created

Hope this help someone who still love Ubuntu 12.04 and Qt.

Community
  • 1
  • 1
Mikolasan
  • 626
  • 10
  • 19
  • This solved my issue, when I type gdb --version on terminal it was showing error like python module load failed. Then I proceed the above steps and works fine, I have used the `--prefix=/usr` instead `--prefix=/usr/local` while configuring, so the Qt creator easily find the debugger without additional setting change. – Haris Apr 06 '16 at 17:50
  • additionally to the above instructions, I had to install termcap libraries: `sudo apt-get install libncurses5-dev` but everything else worked, so thx! – mBardos Oct 07 '16 at 12:34