简体   繁体   English

在Qt Creator下使用CDB漂亮地打印QHash

[英]Pretty printing of a QHash with CDB under Qt Creator

I'm using the following compilers: 我正在使用以下编译器:

  • MinGW 4.9.2 32Bit MinGW 4.9.2 32位
  • Microsoft Visual C++ Compiler 12.0 (x86) Microsoft Visual C ++编译器12.0(x86)

with the following debuggers, respectively: 分别使用以下调试器:

  • GNU gdb 7.8 for MinGW 4.9.2 32Bit 适用于MinGW 4.9.2 32位的GNU gdb 7.8
  • CDB (\\Windows Kits\\8.1\\Debuggers\\x86\\cdb.exe) CDB(\\ Windows Kits \\ 8.1 \\ Debuggers \\ x86 \\ cdb.exe)

with Qt Creator 3.5.0 and Qt 5.4.2. 使用Qt Creator 3.5.0和Qt 5.4.2。

What I would like to see is the pretty printed ("high level") interpretation of a QHash within the debugger watch view. 我想看到的是在调试器监视视图中对QHash的漂亮打印(“高级”)解释。 See eg this post: https://blog.qt.io/blog/2009/06/22/peek-and-poke/ 参见此帖子: https : //blog.qt.io/blog/2009/06/22/peek-and-poke/

The pretty printing works with gdb + MinGW but not with CDB + MSVC2012. 漂亮的打印功能适用于gdb + MinGW,但不适用于CDB + MSVC2012。 In the latter, I can only see the 'low level' interpretation. 在后者中,我只能看到“低级”解释。

What do I have do to get this work with CDB + MSVC2012 too? 我也该如何使用CDB + MSVC2012进行这项工作?

You will need to add a correct debugging addin dll into the visual studio installation directory C:\\Program Files\\Microsoft Visual Studio ${num}\\Common7\\IDE or preferably the add-in directory ( default is %USERPROFILE%\\Documents\\Visual Studio ${num}\\Addins ). 您将需要在C:\\Program Files\\Microsoft Visual Studio ${num}\\Common7\\IDE安装目录C:\\Program Files\\Microsoft Visual Studio ${num}\\Common7\\IDE或最好在外接C:\\Program Files\\Microsoft Visual Studio ${num}\\Common7\\IDE目录中添加正确的调试插件dll(默认为%USERPROFILE%\\Documents\\Visual Studio ${num}\\Addins )。

Qt already provide a complete set of tools for MSVC integration which can be built from one of the qt git vstool project . Qt已经提供了一套完整的MSVC集成工具,可以从qt git vstool项目之一构建

There is a wiki which provide a step by step guide to make it work. 有一个Wiki,它提供了逐步指导以使其工作。 Basically : 基本上:

  • get the project from repository 从资源库获取项目
  • create the solution files 创建解决方案文件
  • build the correct solution, as there is one for each pair Qt4\\Qt5 x VsVersion 建立正确的解决方案,因为每对Qt4\\Qt5 x VsVersion
  • Copy the target dll to the addin directory. 将目标dll复制到addin目录。

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

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