设置 Qt Creator 以调试到 Qt 类 [英] Setup of Qt Creator to debug into Qt classes

查看:73
本文介绍了设置 Qt Creator 以调试到 Qt 类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想以某种方式设置 Qt Creator (3.0),以便我可以调试到 Qt 类中.所以我下载了相应的 src 代码(http://gitorious.org/qt/qt5)并将其安装在一个目录中(例如c:\Qt5\src).

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).

然后我有了自己的项目.我需要在哪里设置 Qt 的源代码路径(c:\Qt5\src),以便我可以调试我的代码,但也可以在必要时进入 Qt 类.

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.

-- Pavel 的评论 --

-- Pavel's comment --

Pavel 给出了一个很好的提示:但我使用的是 Qt/Qt Creator 的预编译版本.所以我基本上是在寻找一个不需要我从源代码编译的解决方案.然而,一个有用的提示.谢谢.

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.

推荐答案

如果您使用的是预构建版本,只需按照 http://doc.qt.io/qtcreator/creator-debugger-engines.html

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

映射源路径

使调试器能够单步执行代码并显示源代码在不同位置使用源树副本时的代码构建库的那个,将源路径映射到目标路径:

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:

  • 选择工具 > 选项 > 调试器 > 常规 > 添加.
  • 在源路径字段中,指定调试器报告的可执行文件调试信息中的源路径.
  • 在目标路径字段中,指定源树在本地计算机上的实际位置.

要获取调试器报告的可执行文件的调试信息中的源路径",您可以激活调试时在堆栈视图中使用工具提示" 选项通过在堆栈视图中右键单击并将鼠标移动到特定的函数调用上.

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.

这篇关于设置 Qt Creator 以调试到 Qt 类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆