Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setup of Qt Creator to debug into Qt classes

Tags:

I want to setup Qt Creator (3.0) in a way, that I can debug into the Qt classes. So I download the corresponding src code (http://gitorious.org/qt/qt5) and install it in a directory (e.g. c:\Qt5\src).

Then I have my own project. Where do I need to set the source code path of Qt (c:\Qt5\src), so I can debug my code, but also into a Qt class where necessary.

-- Edit:Pavel's comment --

Pavel has given a good hint: But I am using a precompiled version of Qt/Qt Creator. So I am basically looking for a solution which does not require me to compile from source. Nevertheless a useful hint. Thanks.

like image 626
Horst Walter Avatar asked Jan 30 '14 23:01

Horst Walter


People also ask

What is Qt debug information files?

Debug information files allow Sentry to extract stack traces and provide more information about crash reports for most compiled platforms. Information stored in debug files includes original function names, paths to source files and line numbers, source code context, or the placement of variables in memory.


2 Answers

If you are using a prebuilded version just remap the source code location as described in http://doc.qt.io/qtcreator/creator-debugger-engines.html

Mapping Source Paths

To enable the debugger to step into the code and display the source code when using a copy of the source tree at a location different from the one at which the libraries where built, map the source paths to target paths:

  • Select Tools > Options > Debugger > General > Add.
  • In the Source path field, specify the source path in the debug information of the executable as reported by the debugger.
  • In the Target path field, specify the actual location of the source tree on the local machine.

To get "the source path in the debug information of the executable as reported by the debugger", you can activate the "Use Tooltips in Stack-View when Debugging" option by right-clicking in the Stack View and move the mouse over a specific function call.

like image 66
JLM Avatar answered Sep 23 '22 01:09

JLM


If you look into the tooltips, you will see references to /Users/qt/work, the Mac deployed debug symbols are pointing there. Of course, this is not documented, as these folks want you to buy enterprise.

If you create the /Users/qt/work directory (as root), then make a soft link to your source directory named qt, everything will work. No need to build anything from source (under Mac that would result in tens of gigs wasted). Same considerations about plugins

Example:

sudo -s mkdir /Users/qt cd /Users/qt mkdir work cd work ln -s /Users/your_user_name/Qt/your_qt_release/Src qt 

Everything will work. Any source mapping failed here, so leave those alone. Hope this helps

like image 28
3 revs, 3 users 62%user962247 Avatar answered Sep 24 '22 01:09

3 revs, 3 users 62%user962247