Debugging ncurses application in Eclipse IDE (Linux) - c

I'm creating an ncurses application in the Eclipse IDE (for C/C++ developers), running on Linux Mint. I'm able to successfully launch the application in the gnome terminal from Eclipse, via an external tool configuration, as per the following post:
http://damienlearnsperl.blogspot.com/2015/03/experimenting-with-ncurses-on-linux-in.html
However, so far I've been unable to run the Eclipse debugger alongside the gnome terminal. Running the debugger within Eclipse doesn't work either, since I only see the "Error opening terminal: unknown." message, after which the application is terminated.
I've tried several suggestions found on google, but none of them seem to work, or they're related to outdated/other versions of Eclipse:
Debugging ncurses with Eclipse CDT
https://wiki.eclipse.org/CDT/User/FAQ#HOWTO_debug_applications_which_require_a_real_terminal
https://www.eclipse.org/forums/index.php/t/44886/
The "Attach to Application" option doesn't seem to work either, I'm only seeing "failure to attach to process" errors when trying to attach the debugger to a running gnome terminal.
Any suggestions?
Many thanks,
Ksawery

Related

debugging error "interpreter `mi2' unrecognized" with eclipse

Debugging with eclipse ide I get this error:
"Error in services launch sequence. Interpreter `mi2' unrecognized."
This was all working a month ago so for some reason it has stopped.
I know mi2 is something to do with GDB.
Code is built using gcc-8.3.0-2019.08.0, using Freedom Studio SiFive Eclipse IDE for C/C++ Development
Version: 4.12.0.2019-08-2
I realise this is a bit niche so any suggestions welcome
Solution:
Recreate Project using Freedom-E SDK Software Project for my project - which was e310 arty (I had selected the wrong one in starting the project).
When debugging use configuration for "SiFive GDB OpenOCD Debugging."
This seemed to work.

OSX Eclipse CDT stalls at the start of debugging: "Configuring GDB"

I have installed Eclipse CDT and GDB.
I created a simple "Hello World" C project.
When I try to debug the project, GDB starts to behave very chaotic: I am able to debug a few times, step through the code, etc., but then it starts stalling at the begining of the next debug session with the message "Configuring GDB".
After I restart Eclipse CDT sometimes I still cannot debug, and sometimes I can, but also just for a few times, and then again the same problem comes up: stalls with "Configuring GDB" message.
I have tried hard to find the pattern, but failed.
What could be the reason for such a chaotic behaviour?
p.s.
I forgot to mention that I did sign the /usr/local/bin/gdb executable (and verified it with codesign --verify --verbose gdb).
Edit:
The screenshot shows the 2 stuck sessions:

Error while launching gdb version Eclipse

Here is an issue I've worked around by simply not using Eclipse for debugging, but it's getting out-of-hand.
I've used Eclipse Helios, Juno and Kepler over the last year and they all display exactly the same problem when I try to debug a local C/C++ application.
When I try to debug, it simply reports the error "Error while launching gdb --version".
gdb is in my path, but to be sure, I change the Debug settings to list the path explicitly. If I do that, I simply get "Error while launching /usr/bin/gdb --version", which is no better.
I'm using Scientific Linux version 6.4 (as required by my customers) and currently, I'm trying to use Eclipse Kepler. Running from the command line, gdb has no problem reporting it's version:
# gdb --version
GNU gdb (GDB) Red Hat Enterprise Linux (7.2-60.el6)
[... licensing info]
Please, please let me know how to fix this as I have spent weeks working at only a fraction of the rate I would expect because I'm not utilizing an integrated development environment, but using separate tools.
I've seen other similar posts, but they are either
(a) about Windows / MingW - although I've tried their ideas anyway, just in case they work.
(b) don't have any answer provided.
As Scientific Linux is a RedHat derivative, I expect RHEL or CentOS information would be as relevant for me.

Eclipse will not run C programs

I just recently installed the CDT plugin for Eclipse in Windows 8 and I'm getting the error:
"Launch failed. Binary not found."
Now I've looked into this and I have installed cygwin with gcc and set that up in Eclipse settings. I went to Window>Preferences>New C/C++ Project Wizard>Makefile Project and checked Cygwin PE Parser (and just in case I checked PE Windows Parser as well).
Then I went to Window>Preferences>Build>Environment and added my PATH variable there. I made sure to add C:\cygwin64\bin to my PATH in my system settings, and I know this is valid because I checked that location and I have successfully run gcc through the command line as well as the cygwin terminal. On top of this, if I build my project in Eclipse and then navigate to that directory outside of Eclipse and run the .exe that it creates by double-clicking on it, it also runs properly.
I'm at a loss for why Eclipse can't run it but everything else can...Any suggestions?
right click your project in eclipse "project explore" -> Run as -> Run configuration
=>select your project name then check "Main" tab, in C/C++ application file. is it point to your binary file?
E.g:
Debug/TestProj.exe

How to make a run configuration in eclipse using CDT

I'm trying to compile a code i made in C in Debian using CDT for Eclipse and i'm having the famouse Binary not found error when i try to compile the code. I already build the code by pressing Ctrl+B and the Debug folder appears, and the code doesn't have any syntax error, but the error still there. After that i tried to make a run configuration for my project but i'm not sure about what to put where it say's C/C++ Application. Which is the best configuration for this problem?
I'm using Debian Squeeze, Eclipse CDT and GCC as compiler
If you have successfully built your project and have an executable you can run (no build errors, project properly configured as executable), just press a "search project" or "browse" button in "debug configurations" dialog and point it to your executable.

Resources