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

查看:48
本文介绍了如何在 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/发布/伽利略 到存储库列表.
  3. 选择 CDT 存储库.现在您需要从可用插件列表中安装 CDT 插件以及 GDB 支持(选择 CDT 主要功能以及 CDT GNU 工具链调试支持).

您现在应该能够在 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天全站免登陆