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.
The segmentation error is one of the runtime error, that is caused because of the memory access violation, like accessing invalid array index, pointing some restricted address etc. In this article, we will see how to detect this type of error using the GDB tool.
Use debuggers to diagnose segfaults Start your debugger with the command gdb core , and then use the backtrace command to see where the program was when it crashed. This simple trick will allow you to focus on that part of the code.
Hello
You could try to modify the run configuration like this
/bin/sh
-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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With