如何在Eclipse中使用GDB进行C / C ++调试? [英] How do I use GDB in Eclipse for C/C++ Debugging?

查看:105
本文介绍了如何在Eclipse中使用GDB进行C / C ++调试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一个Visual Studio用户,用于断点进行调试。我现在正在linux环境中工作,并将Eclipse用作IDE。我是linux和eclipse的新手。我不知道如何在eclipse中使用gdb。我尝试在命令行中使用gdb,但不像使用UI那么简单。

I'm a Visual Studio user and am used to breakpoints for debugging. I'm now working in a linux environment and am using Eclipse as an IDE. I'm a newbie in linux and eclipse. I don't have any idea how to use gdb in eclipse. I tried using gdb in command line, but is not as easy as having a UI.

如何在eclipse中使用gdb?

How do I use gdb in eclipse?

推荐答案

以下说明适用于Eclipse 3.5(Galileo)。对于3.6(Helios),除了步骤2中的链接之外,它们是相似的。

The following instructions are for Eclipse 3.5 (Galileo). For 3.6 (Helios), they are similar except for the link in step 2.


  1. 转到帮助>安装新软件。 >
  2. 添加CDT存储库 http://download.eclipse.org / tools / cdt / releases / galileo 到存储库列表。

  3. 选择CDT存储库。现在,您需要从可用插件列表中选择CDT插件以及GDB支持(选择CDT主要功能以及CDT GNU Toolchain Debug支持)。

  1. Go to Help > Install New Software.
  2. Add the CDT repository http://download.eclipse.org/tools/cdt/releases/galileo to the list of repositories.
  3. Select the CDT Repository. Now you need to install the CDT plugin along with GDB support from the list of available plugins (Select the CDT Main Features as well as CDT GNU Toolchain Debug support).

您现在应该能够设置断点和检查Eclipse中的变量值。

You should now be able to set breakpoints and inspect values of variables in Eclipse.

另一种方法是安装DDD(GDB的GUI前端)。

An alternative is to install DDD (an GUI frontend for GDB).

这篇关于如何在Eclipse中使用GDB进行C / C ++调试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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