问题
如标题所述,使用QT在CDB调试器在qtcreator下调试时,发现,若调试的位置存在QString、QByteArray等QT库的变量,则会导致所有变量的值无法查看,鼠标移动到对应变量位置也只能查看到too complex。
环境
QT6.6.1+MSVC2019+CDB
修复方案
1、在调试器的CDB模块下取消勾选Use Python dumper;
2、找到项目构建目录,将该目录删除;
该步骤用于确保项目重新完整构建,防止出现第一步已经取消勾选Use Python dumper,但是仍然查看不了变量的情况。
问题分析
知道了解决方案,更需要了解问题出现的原因,防止以后遇到类似的错误。
查询QT官方文档
了解到其中关于python dumper的描述如下 :
As the format is not guaranteed to be stable, it is strongly recommended not to generate the wire format directly, but to use the abstraction layer of the Python Dumper classes, specifically the class itself, and the and abstractions. These offer a complete framework to take care of the and fields, to handle children of simple types, references, pointers, enums, and known and unknown structs, as well as some convenience functions to handle common situations.DumperDumper:ValueDumper:Typeinameaddr
When using CDB as debugger backend, you can enable the Python dumper by selecting Preferences > Debugger > CDB > Use Python dumper.
可以了解到,该选项启动python dumper是为了利用额外的工具来抽象化debug时查看的变量类型,使其规范化。由此推测,可能是该工具与CDB存在兼容性问题导致的。