配置Qt Creator以使用GDB [英] Configure Qt Creator to work with GDB

查看:231
本文介绍了配置Qt Creator以使用GDB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的机器中有GDB和CDB。我的Qt创建者正在使用CDB进行调试。

我试图指向GDB路径,但它不起作用。



如何设置Qt Creator使用GDB进行调试?

解决方案

确保你已经将Qt Creator设置为Debug构建配置(Build菜单 - > Set build configuration - > Debug)。这听起来很明显,但我却意外地设置为Release,并花费数小时寻找gdb配置问题,当Qt Creator默默地忽略了我的断点时,尽管我使用Start Debugging命令运行该应用程序。



另外请注意,在这种情况下重新配置Qt Creator进行调试构建可能还不够,但是您还必须执行完整重建以使配置更改适用于整个项目(是,这是我不得不做的一个额外步骤)。

Qt Creator如果尝试使用发布配置来调试构建,如Visual Studio从很久以前就做到了。它会避免那些沉默失败。


I have both GDB and CDB in my machine. My Qt creator is using the CDB for debugging.

I tried to point to the GDB path, but it doesn't work.

How do I set Qt Creator to debug using GDB?

解决方案

Ensure that you have set up Qt Creator to the "Debug" build configuration (Build menu -> Set build configuration -> Debug). It may sound obvious, but I had mine accidentally set to "Release", and spent hours looking for gdb configuration problems when Qt Creator silently ignored my breakpoints despite me running the application with the "Start Debugging" command.

Also note that reconfiguring Qt Creator for debug builds may not be enough in this case, but that you will then have to perform a full rebuild as well to make the configuration changes apply throughout your project (yes, this was an additional step I had to do).

Qt Creator could really do with a warning dialog if you attempt to debug builds with the release configuration, like Visual Studio does it since ages ago. It would avoid those silent fails.

这篇关于配置Qt Creator以使用GDB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆