简体   繁体   English

在Qt Creator中调试应用程序时,如何使Qt源代码可用?

[英]How do you make the Qt source code available when debugging an application in Qt Creator?

I recently decided to compile Qt from source. 我最近决定从源代码编译Qt。 I was under the mistaken understanding that doing so would mean that I would now be able to see the Qt source code when debugging my applications. 我错误地认识到这样做意味着我现在能够在调试我的应用程序时看到Qt源代码。 However, when my stack involves Qt code, the stack is still shown in grey in the right panel and only bytecode is shown for the execution. 但是,当我的堆栈涉及Qt代码时,堆栈仍然在右侧面板中显示为灰色,并且仅显示执行的字节代码。

在此输入图像描述

Is there a specific option I need to pass to the configure script to enable this? 我是否需要传递给configure脚本以启用此选项? Is this even possible? 这甚至可能吗?

I meet the similar problem when using Emacs+gdb. 我在使用Emacs + gdb时遇到了类似的问题。 The problem was that path to source code compiled in library was something like src/core/qobject.cpp or even core/qobject.cpp. 问题是在库中编译的源代码的路径类似于src / core / qobject.cpp甚至是core / qobject.cpp。 So debuger can not find suitable source file when I walk up and down through call stack. 因此,当我在调用堆栈中上下走动时,debuger无法找到合适的源文件。 I solve the problem just configure gdb's search path. 我只是配置gdb的搜索路径来解决问题。 In qt creator you can try fix it by finding option to configure "gdb" parameters and add "-d path/to/qt/source/code" to gdb command line arguments. 在qt creator中,您可以通过查找配置“gdb”参数的选项并将“-d path / to / qt / source / code”添加到gdb命令行参数来尝试修复它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM