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

Viewed 4659

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.

2 Answers

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.

Related