c++ - Stepping into Qt sources in Qt Creator (in Ubuntu Linux) -


i'm using qt creator in ubuntu. it's installed repositories now, there no way step qt sources when debugging.

how can enable that?

since qt creator uses gdb, need configure gdb. first thing install qt debugging symbols:

apt-get install libqt4-dbg 

or, qt5:

apt-get install qtbase5-dbg # qtbase package 

this install debugging symbols qt libraries. older releases of ubuntu had silly bug required additional trick correct symbol files, in current release works fine.

this make gdb step inside qt methods, it's no fun without sources. need sources can installed this, assuming source repository enabled in apt:

apt-get source qt4-x11 ln -s qt4-x11-4.7.0 qt # convenience symlink 

or, qt5:

apt-get source qtbase-opensource-src # make link above, if wish 

this download sources, unpack them current directory , patch them accordingly, no root privileges needed unless current dir isn't writeable current user.

and last thing inform gdb of sources location, done putting in ~/.gdbinit file:

dir ~/vita/qt/src/corelib dir ~/vita/qt/src/gui dir ~/vita/qt/src/network dir ~/vita/qt/src/sql 

add modules , correct paths needed. convenience symlink useful here, don't have edit file each time upgrade new qt version. need download new sources, patch them , change symlink.

note have installed debugging symbols, still use release build of qt libraries. means code highly optimized , behave strange when stepping inside qt binaries. if problem, necessary build qt in debug mode, install separately (say, in /usr/local/qt4-debug) , tell qt creator use particular installation.


Comments

Popular posts from this blog

WPF: binding viewmodel property of type DateTime to Calendar inside ItemsControl -

java - Getting corefrences with Standard corenlp package -

jQuery clickable div with working mailto link inside -