Qt Creator调试器非常慢

12

我正在使用 Qt Creator 调试器,但当我想通过从 局部变量和表达式 视图中展开当前的 this 变量来检查它时,它需要相当长的时间(大约 30 秒)才能重新控制。

我注意到在 调试器日志 视图中出现了以下消息:

3518fetchVariables({"autoderef":1,"context":"","displaystringlimit":"100","dyntype":1,"expanded":["return","inspect","local.this","watch","local"],"fancy":1,"formats":{},"nativemixed":0,"partialvar":"local.this","passexceptions":0,"qobjectnames":1,"stringcutoff":"10000","token":3518,"typeformats":{},"watchers":[]})
(lldb) script theDumper.fetchVariables({"autoderef":1,"context":"","displaystringlimit":"100","dyntype":1,"expanded":["return","inspect","local.this","watch","local"],"fancy":1,"formats":{},"nativemixed":0,"partialvar":"local.this","passexceptions":0,"qobjectnames":1,"stringcutoff":"10000","token":3518,"typeformats":{},"watchers":[]})
bridgemessage={msg="Searching for type QObjectPrivate across all target modules, this could be very slow"},
eERROR: Lldb stderr: error: PlaybackDevice.o DWARF DW_TAG_array_type DIE at 0x0000db86 has a class/union/struct element type DIE 0x0000db92 that is a forward declaration, not a complete definition.
Try compiling the source file with -fno-limit-debug-info or disable -gmodule

我正在使用:

  • Qt 5.9.2
  • Qt Creator 4.5.0
  • OSX 10.12.6.

编辑:

根据Kuba Ober的建议,我正在使用Qt的调试版本(5.10.0),感谢这个链接: Qt Creator debugger very slow

不幸的是,消息已经改变为:

eERROR: Lldb stderr: error: PlayBackDevice.o DWARF DW_TAG_array_type DIE at 0x0000f43e has a class/union/struct element type DIE 0x0000f44a that is a forward declaration, not a complete definition.
Try compiling the source file with -fno-limit-debug-info or disable -gmodule

这可能取决于您的“this”变量包含什么,或者即使对于简单对象,它是否总是很慢? - xander
this 继承自 QObject。如果 this 是一个简单对象,它会迅速扩展。 - Martin Delille
3
请注意日志中的以下信息:"Searching for type QObjectPrivate across all target modules, this could be very slow" - Martin Delille
3个回答

13

我遇到了同样的问题。解决方法是在QtCreator首选项 -> 调试器 -> 本地和表达式中取消勾选“如果可用,则显示 QObject 名称”。


你救了我 :) - rkudinov
啊,终于可以使用Qt Creator调试器而不用抓狂了! - Bri Bri

3

我猜你没有使用Qt的调试版本。虽然这个“bug”很烦人,但实际上它确实迫使你使用Qt的调试版本来调试你的项目。这会让你的工作效率更高——在你可以有意义地进入Qt代码时,很多问题都更容易解决。


听起来很有前景。有什么办法能实现这个目标吗? - Martin Delille
1
Qt的调试版本通常由您自己来处理 - 要获取完整的调试信息,您需要三个要素:调试二进制文件、调试符号和源代码。实际上,如果没有设置好Qt的编译环境,这将是一个很大的障碍。qt.io下载似乎是针对初学者和学生实验室的。一旦您认真对待它,使用那些二进制文件会带来更多麻烦,不值得这么做。 - Kuba hasn't forgotten Monica
我该如何获取它们? - Martin Delille
1
好的,这里似乎已经很好地解释了一切:https://wiki.qt.io/Building_Qt_5_from_Git - Martin Delille
尽管使用调试版本,但我仍然存在问题… - Martin Delille
显示剩余4条评论

0

我曾经遇到过类似的问题,大部分都是通过将编译器更改为与我使用的lldb在同一目录下的Clang来解决的。(顺便说一句,那个Clang的文件名是gcc。)


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接