简体   繁体   English

如何在 Qt Creator 中配置 CDB?

[英]How to configure CDB in Qt Creator?

The question here is the same as mine but the solution there is not working for me.这里的问题与我的相同,但那里的解决方案对我不起作用。 I am using QtCreator 2.4.1 on Windows 7. When I try to debug a simple hello world app the message displayed is: "The preferred debugger engine for debugging binaries of type 'x86-windows-msvc2010-pe-32bit' is not available....Details: There is no CDB binary available for binaries in format 'x86-windows-msvc2010-pe-32bit"我在 Windows 7 上使用 QtCreator 2.4.1。当我尝试调试一个简单的 hello world 应用程序时,显示的消息是:“用于调试‘x86-windows-msvc2010-pe-32bit’类型二进制文件的首选调试器引擎不可用....详细信息:没有可用于格式为“x86-windows-msvc2010-pe-32bit”的二进制文件的 CDB 二进制文件

When I found that cdb.exe was not on my system I had Windows SDK installed with debugger tools and the current location of cdb.exe is "C:\\Program Files (x86)\\Windows Kits\\8.0\\Debuggers\\x86\\cdb.exe" and "C:\\Program Files (x86)\\Windows Kits\\8.0\\Debuggers\\x64\\cdb.exe",当我发现 cdb.exe 不在我的系统上时,我安装了带有调试器工具的 Windows SDK,并且 cdb.exe 的当前位置是“C:\\Program Files (x86)\\Windows Kits\\8.0\\Debuggers\\x86\\cdb。 exe”和“C:\\Program Files (x86)\\Windows Kits\\8.0\\Debuggers\\x64\\cdb.exe”,

In the CDB tab I configured symbol server as well as the path of CDB.exe, but in vain!在CDB选项卡中我配置了符号服务器以及CDB.exe的路径,但是没有用!

QtCreator->Tools->options->Debugger->CDB Tab->has the following fields: QtCreator->Tools->options->Debugger->CDB Tab->有以下字段:
Additional arguments附加参数
use CDB console使用 CDB 控制台
Symbol Paths符号路径
Source Paths源路径
Correct breakpoint location etc...正确的断点位置等...

Can somebody kindly explain in detail what these mean and what values are expected here.有人可以详细解释这些含义以及此处期望的值。 Has anybody successfully debugged any applicaiton using Qt Creator.有没有人使用 Qt Creator 成功调试过任何应用程序。


Please refer this link:请参考这个链接:
http://qt-project.org/forums/viewthread/16018/ http://qt-project.org/forums/viewthread/16018/

I was having the same problems too, and finally figured out how to solve this.我也遇到了同样的问题,终于想出了如何解决这个问题。 Styne666 gave me a hint. Styne666给了我一个提示。 Do the following:请执行下列操作:

  1. Tools工具
  2. Options...选项...
  3. Build & Run构建和运行
  4. Tool Chains工具链
  5. Use the "Clone" button to make a copy of each of the auto-detected MSVC items使用“克隆”按钮复制每个自动检测到的 MSVC 项目
  6. In each of the cloned items, you can specify the debugger in the "Debugger" field (eg C:\\Program Files\\Windows Kits\\8.0\\Debuggers\\x64\\cdb.exe)在每个克隆项中,您可以在“调试器”字段中指定调试器(例如 C:\\Program Files\\Windows Kits\\8.0\\Debuggers\\x64\\cdb.exe)
  7. After this everything seems to work...在此之后,一切似乎都有效......

I should further mention that if you are running a 64-bit version of Windows and a 32-bit version of Qt Creator like I am, you need to make sure that you are pointing to the 32-bit versions of cdb (of which there are x86 and x64 target versions).我应该进一步提到,如果您像我一样运行 64 位版本的 Windows 和 32 位版本的 Qt Creator,您需要确保指向 32 位版本的 cdb(其中有是 x86 和 x64目标版本)。 So for the 32-bit target builds I run this:因此,对于 32 位目标版本,我运行以下命令:

C:\Program Files (x86)\Windows Kits\8.0\Debuggers\x86\cdb.exe

And for x64 builds I run this:对于 x64 构建,我运行这个:

C:\Program Files (x86)\Windows Kits\8.0\Debuggers\x64\cdb.exe

The tricky part is that it is somewhat difficult to get Microsoft to install the 32-bit version of the debugging tools on your 64-bit machine.棘手的部分是让 Microsoft 在您的 64 位机器上安装 32 位版本的调试工具有些困难。 A co-worker tried to do so recently and said that he needed to install the Windows 8 tools in order to have the option to do that - the Windows 7 versions would not let you.一位同事最近尝试这样做,并说他需要安装 Windows 8 工具才能选择这样做 - Windows 7 版本不会让你这样做。

Took me some time to figure out this with Qt Creator 2.6.0 (on Windows 7), so here it is:我花了一些时间用 Qt Creator 2.6.0(在 Windows 7 上)弄清楚这一点,所以这里是:

  • Tools, Options...工具、选项...
  • Build & Run, Kits tab, select "Desktop (default)" (under Manual)构建和运行,套件选项卡,选择“桌面(默认)”(在手动下)
  • Click the Manage button and select Edit on the right side of "Debugger:"单击“管理”按钮,然后选择“调试器”右侧的编辑:
  • Engine: CDB, Binary: C:\\Program Files\\Debugging Tools for Windows (x64)\\cdb.exe引擎:CDB,二进制:C:\\Program Files\\Debugging Tools for Windows (x64)\\cdb.exe

Depending on the version of Visual Studio you have installed you can find the CDB.exe in different locations.根据您安装的 Visual Studio 版本,您可以在不同位置找到 CDB.exe。 Check if it is available in your system by searching in C:\\ drive.通过在 C:\\ 驱动器中搜索来检查它是否在您的系统中可用。

In my case I have Windows 7 (x64) with Visual Studio 2012 Express and Visual Studio 2013 installed and I had to install Microsoft Windows SDK for Windows 7 available here in order to have CDB.exe in my system.就我而言,我安装了带有 Visual Studio 2012 Express 和 Visual Studio 2013 的 Windows 7 (x64),我必须在此处安装适用于 Windows 7 的 Microsoft Windows SDK,以便在我的系统中安装 CDB.exe。 After the install, QT Creator was able to detect CDB.exe in this location: C:\\Program Files\\Debugging Tools for Windows (x64)\\cdb.exe.安装后,QT Creator 能够在以下位置检测到 CDB.exe:C:\\Program Files\\Debugging Tools for Windows (x64)\\cdb.exe。

The only thing you need from the SDK is the Common Utilities | SDK 中唯一需要的是 Common Utilities | Debugging Tools For Windows. Windows 调试工具。

I try, first install Visual Studio 2010 , After, then in CDB Binary puts: C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\IDE\\Remote Debugger\\x86\\mpishim100.exe , or only download this file!..我试试,先安装Visual Studio 2010 ,之后,然后在CDB Binary puts: C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\IDE\\Remote Debugger\\x86\\mpishim100.exe ,或者只下载这个文件! ..

Its the solution!!!它的解决方案!!! In windows 8 64 bits!!在 Windows 8 64 位中!!

I got this error because the version of Visual Studio I had installed was much older than the version of Qt I had installed.我收到此错误是因为我安装的 Visual Studio 版本比我安装的 Qt 版本旧得多。 I had Visual Studio 2015 installed, but my (much more recent) version of Qt was using Visual Studio 2019's compiler, which apparently isn't compatible with Visual Studio 2015's debugger.我安装了 Visual Studio 2015,但我的(更新的)Qt 版本使用的是 Visual Studio 2019 的编译器,这显然与 Visual Studio 2015 的调试器不兼容。

The solution in my case was to uninstall and reinstall both Visual Studio and Qt to make sure I have the latest version of both.我的解决方案是卸载并重新安装 Visual Studio 和 Qt,以确保我拥有两者的最新版本。 You can download the latest version of Visual Studio here (if you don't want to pay you should select "Free download" under "Community"), and you can download the latest version of Qt here .你可以在这里下载最新版本的Visual Studio(如果你不想付费可以在“社区”下选择“免费下载”),你可以在这里下载最新版本的Qt。

It sounds like what I encountered on OSX with the gdb.这听起来像我在 OSX 上遇到的 gdb。 If so, the solution for me was (within Qt Creator):如果是这样,我的解决方案是(在 Qt Creator 中):

  1. Tools工具
  2. Options...选项...
  3. Build & Run构建和运行
  4. Qt Versions Qt 版本
  5. Select the corresponding version选择对应版本
  6. Expand the Details panel展开详细信息面板
  7. Press the Build button which is inline with "GDB Helper"按与“GDB Helper”内联的构建按钮

In your case, the text would likely be different (CDB instead of GDB perhaps) but the same steps may apply.在您的情况下,文本可能会有所不同(可能是 CDB 而不是 GDB),但可能适用相同的步骤。

  1. Re install windows sdk for respective windows为相应的窗口重新安装 windows sdk
  2. Correctly configure release/debug dll correctly for any external libraries为任何外部库正确配置发布/调试 dll

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

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