Qt Creator 调试器非常慢

Qt Creator debugger very slow

我正在使用 Qt Creator 调试器,但是当我想通过从 局部变量和表达式 扩展它来检查当前 this 变量时=37=] 看来,在交还控制权之前需要相当长的时间(大约 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) 的调试版本,多亏了这个 link:

很遗憾,消息已更改为:

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

我想您使用的不是 Qt 的调试版本。虽然这个 "bug" 很烦人,但它实际上会强制您使用 Qt 的调试版本来调试您的项目。它应该会让您更有效率 - 当您可以有意义地进入 Qt 代码时,许多问题更容易解决。

我遇到了同样的问题。为我修复它的是在 QtCreator 首选项 -> 调试器 -> 局部变量和表达式中取消勾选 "Show QObject names if available"。

我遇到了类似的问题,这些问题大多通过将我的编译器更改为与我正在使用的 lldb 相同目录中的 Clang 来解决。 (顺便说一下,Clang 的文件名是 gcc。)