Debugging a Qt application with Qt Creator: <no this value>

I am using Qt Creator with Qt 5.1.1 on Ubuntu 12.04. When I use the debugger to display the contents of any variable, the window always shows β€œno such value” for each variable. Also for variables like QString , int , etc. Is there a configuration problem with my Ubuntu? Can anybody help me?

+7
debugging qt-creator
source share
1 answer

This was a year and a half ago, but the problem remains relevant for Ubuntu 12.04, Qt Creator 3.4.0 based on Qt 5.4.1.

As stated in the Qt Creator Guide

Starting with version 3.1, Qt Creator requires a Python script extension. GDB builds without Python scripts is no longer supported and will not work. The minimum supported version of GDB is 7.5 using Python version 2.7 or 3.3 or later.

I believe gdb --version gives you 7.4 (the latest version of gdb for Ubuntu 12.04). That is why you do not have such a problem with value.

1. Install new gdb (7.8)

Remove the current gdb (to avoid conflicts with the new one) and install the development package for python ( to build gdb using Python scripts)

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

Install gdb from 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 located in /usr/local .

2. Update Qt Creator Settings

  • Go to Tools > Options ...
  • Select Build&Run , Debuggers tab
  • Click Add
  • Enter the name you like, write the path: /usr/local/bin/gdb

  • In the Kits tab, change the Debugger: just created

Hope this help helps someone who still loves Ubuntu 12.04 and Qt.

+3
source share

All Articles