【问题标题】:Qt Creator debugger very slowQt Creator 调试器非常慢
【发布时间】:2018-06-13 02:06:03
【问题描述】:

我正在使用 Qt Creator 调试器,但是当我想通过从 Locals 和表达式 视图展开来检查当前的 this 变量时,需要相当长的时间在交还控制权之前很长(大约 30 秒)。

我在 Debugger Log 视图中注意到以下消息:

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 变量包含什么,或者即使对于简单的对象也总是很慢?
  • this 继承 QObject。如果this 是一个简单的对象,它会很快扩展。
  • 请注意日志中的以下消息:"Searching for type QObjectPrivate across all target modules, this could be very slow"

标签: macos qt debugging qt-creator


【解决方案1】:

我遇到了同样的问题。为我解决的问题是取消勾选 QtCreator Preferences -> Debugger -> Locals & Expressions 中的“显示 QObject 名称(如果可用)”。

【讨论】:

  • 你救了我:)
  • 啊,终于不用拔头发就可以使用Qt Creator调试器了!
【解决方案2】:

我猜你没有使用 Qt 的调试版本。虽然这个“错误”很烦人,但它确实迫使您使用 Qt 的调试版本来调试您的项目。它应该让你更有效率——当你可以有意义地进入 Qt 代码时,许多问题会更容易解决。

【讨论】:

  • 听起来很有希望。任何线索如何实现这一目标?
  • 有关信息,我已经从qt.io 安装了 Qt,并在调试配置中编译了我的项目。
  • Qt 的调试版本通常由您自己完成 - 要获得完整的调试信息,您需要三要素:调试二进制文件、调试符号和源代码。在实践中,没有设置为编译 Qt 是一个很大的障碍。我认为 qt.io 下载是针对初学者和学生实验室的。一旦你认真对待它,使用这些二进制文件就麻烦多了。
  • 我怎样才能得到它们?
  • 好吧,这里似乎一切都解释得很好:wiki.qt.io/Building_Qt_5_from_Git
【解决方案3】:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-03-24
    • 2018-07-27
    • 2018-11-08
    • 2013-01-23
    相关资源
    最近更新 更多