如何在Linux上使用Eclipse来调试C ++程序? [英] How Do I Use Eclipse to Debug a C++ Program on Linux?

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

问题描述

我不使用Eclipse作为IDE,并没有兴趣这样做。但是,我喜欢它的源代码级调试。

I don't use Eclipse as an IDE, and have no interest in doing so. However, I do like its source-level debugging.

有没有办法我可以使用它来调试C ++ Linux应用程序,而不需要通过创建项目的仪式? (实际上,我可以使用它像前端gdb吗?)

Is there any way I can use it to debug a C++ Linux app without going through the ritual of creating a project? (In effect, can I just use it like a frontend to gdb?)

如果没有,我需要遵循的步骤来创建一个可以使用的项目只是调试使用Makefile或其他工具(SCons,CMake等)构建的现有C ++程序。我不想在Eclipse中开发所有我需要做的是调试。

If not, what are the steps I need to follow to create a project that I can use to just debug an existing C++ program that is built using Makefiles or other tools (SCons, CMake, etc.). I don't want to be able to "develop" in Eclipse; all I need to do is debug.

推荐答案

看看这个问题。创建一个C / C ++项目,使用项目的源目录作为项目目录,选择使用外部构建器,并将make更改为所需的任何工具。

Take a look at this question. Create a C/C++-project, use your project's source directory as project directory, select to use the external builder, and change "make" to whatever tool you want.

棘手的部分是让索引器正常工作并找到所有头文件。

The tricky part is to get the indexer to work correctly and find all your header files.

编辑:CMake 2.6.x支持生成CDT项目文件,可能是一个更直接的解决方案。

CMake 2.6.x has support for generating CDT project files, which might be a more straightforward solution.

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

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