如何在Unix中调试cpp文件? [英] How to debug a cpp file in unix?

查看:282
本文介绍了如何在Unix中调试cpp文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我已经在c中创建了一个示例应用程序.
为了在UNIX上进行编译和执行,我创建了makefile.
当我从Unix执行C代码时,我想调试它.

如何在unix平台上调试我的c代码?

提前致谢. :-O

Hello,

I had created a sample application in c.
For compilation and execution on unix, i created makefile.
I want to debug my c code, when i execute it from Unix.

How can I debug my c code on unix platform?

Thanks in advance. :-O

推荐答案

我建​​议以下内容:
-控制台工具 [ GUI工具 [
I would suggest the following:
- Console tool[^]
- GUI tool[^] <- very comfortable :)


以及Eugen的建议,推荐 Valgrind [ ^ ].
As well as Eugen''s suggestions, I''d recommend Valgrind[^].


很好的回答,但Poonamol询问的是Unix,而这些都是Linux工具.
大多数Unices都将包含dbx: http://en.wikipedia.org/wiki/Dbx_(debugger)
在某些情况下,您可能不得不依靠adb: http://en.wikipedia.org/wiki/Absolute_Debugger .

请与编译器制造商联系.大多数编译器还将在软件包中引入一个不错的调试器.
sdb也是一个选项(仅C): http://en.wikipedia.org/wiki/Sdb_(debugger)
Nice answers, but Poonamol was asking about Unix, and these are all Linux tools.
Most Unices will include dbx: http://en.wikipedia.org/wiki/Dbx_(debugger)
In some cases you may have to rely on adb: http://en.wikipedia.org/wiki/Absolute_Debugger.

Check with the compiler manufacturer. Most compilers will also throw a nice debugger in with the package.
sdb is also an option (C only): http://en.wikipedia.org/wiki/Sdb_(debugger)


这篇关于如何在Unix中调试cpp文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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