Eclipse cdt 配置显示Segment fault信息

how to let eclipse cdt show runtime error (e.g. segmentation fault)

I develop and run C++ program in Eclipse CDT on Linux.

The problem is that Eclipse CDT does't show any runtime error message (e.g. segmentation fault) in console, while I can get such error message when running program directly with command line.

share | edit
 
Have you tried debugging your code ? –  DumbCoder  Sep 21 '10 at 13:33
 
yes, with debug mode I can get the error message. I just wonder if the "normal run" can give out the messages as well. –  elgcom  Sep 21 '10 at 15:58
2  
I remember getting a "segmentation fault" error in galileo/ganymede. I am not getting the same after I started using eclipse regularly recently. I now use the latest, greatest release, helios. The console is simply blank. –  Abhijith  Sep 27 '10 at 17:09

1 Answer

Hello
You could try to modify the run configuration like this

  • tab 'Main' > Application = /bin/sh
  • tab 'Arguments' > 'Program arguments' = -c "Debug/name_of_executable arg0 arg1 ... 2> /dev/stdout"

(replace "arg0 arg1 ..." with your program arguments, if any)
The eclipse console will output both stdout, stderr and the segmentation fault message (prefixed with "/bin/sh: line 1 ...")
note : I used this solution on an older release of eclipse for which the symptoms are the same.


Eclipse cdt一般能显示程序编译过程,但是最近在调试一个在命令行显示Segment fault的程序在Eclipse中却没有显示。

经过上边的方法能够正常显示了:


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

袁保康

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值