Debugging ncurses with Eclipse CDT - c++

I'm writing a C++ application using ncurses in Eclipse CDT however I can't run/debug my app in eclipse because the console in eclipse does not work with curses. My app runs fine if I run it from a terminal but I just added some new code and now I'm getting a segmentation fault so I'd like to use the debugger in eclipse to help me fix the issue. Is there a way to have eclipse run/debug my application but use a different terminal for the output much like when you do "tty /dev/pts/1" in gdb? Or any other way to debug a ncures application in eclipse?
Thx in advance!

also you should add TERM=xterm to Environment in the Debug Configurations dialog

Related

Debugging in eclipse

My development server is linux server.I access linux server in windows through putty..Recently i started using eclipse CDT for c++ developmet.I add the projects to eclipse through network share(samba).I can also compile the program through eclipse by adding linux server which gives me inbuily putty acesss(no need for me to again login to putty).My problem now is there any way i can do debugging in eclipse also???.Right now all my coding and compiling works are done in eclipse itself only thing missing is debugging.
Have you tried remote debugging? I don't know how your server is set up, but perhaps try what this article is suggesting

Breakpoints do not work on CDT 8.4.0 for Eclipse Luna for Linux

I had good times debugging Java applications on Eclipse, but recently that I'm working on a C/C++ on Ubuntu 12.04 using Eclipse CDT, it ignores the breakpoints when debugging! I've tried two versions of Eclipse CDT, CDT 8.4.0 for Eclipse Luna, but doesn't work either. Can somebody help with that?
NOTE: I know there are some other similar questions, but I was thinking it is better to ask this question which specifically addresses CDT 8.4.0 for Eclipse Luna.
The eclipse-cdt is shipped only with the required tools for building c/c++ applications. It does not ship with gdb. You need to install that separately
How do I use GDB in Eclipse for C/C++ Debugging?
From link above these are the steps to follow.
1. Go to Help > Install New Software.
2. Add the CDT repository http://download.eclipse.org/tools/cdt/releases/8.4 to the list of repositories.
3. Select the CDT Repository. Now you need to install the CDT plugin along with GDB support from the list of available plugins (Select the CDT Main Features as well as CDT GNU Toolchain Debug support).
I updated the CDT repository path to correspond to your release (Luna).
It also happens for me in ReadHat 64
Seems like if the CDT breakpoints are not suitable for the current debug session, in the breakpoint window, when enabling "Show breakpoints Supported by selected target" all my breakpoints disapears from the list.
In my case, my ELF have debug info and all the breakpoints that I place are in the main ELF.
My debug settings worked fine with the former Eclipse version.
I rolled back to eclipse Juno, and my debug session with same elfs worked out of the box.
Experiencing the same problem here.. I am working around it by manually setting breakpoints after starting debug session. Console -> gdb, then type "break xxxx".
If you're using MinGW gdb, check that C:\MinGW\bin is in your path (set in System Properties). Made all the difference for me.
I once had Skip All Breakpoints accidentally checked, and was wondering what was going on.
I have the same problem with my eclipse Photon, I figured it out by unchecking the
"stop on startup at: main" in Debug Configuration-->Debugger.
I know this in Rikard Söderström's response to you.

Debugging a C++ program in Intellij IDEA

I have been successfully run a C/C++ program in Intellij IDEA. But how to debug it? The operation system is Ubuntu 12.04 and Intellij IDEA version is 13.0.3. The path of the gdb is set to /usr/bin/gdb.
The settings in the Run/Debug configurations are also set to its own path.
The problem occurs when start Debugging, nothing happens in the IDE. How to fix it?

Can I use Eclipse CDT to debug a prebuilt C++ executable?

On Linux, I have some C++ programs built with my own makefiles, and I'm looking for some GUI debuggers to debug them at source level.
Previously I use KDbg(2.5.2) on openSUSE(12.3). It works but with some very annoying limitation, e.g., I cannot set a breakpoint when the debugged program is not trapped by Kdbg -- I mean, in order to set a new breakpoint, I have to set it before the program is launched or the program pauses on hitting an already set breakpoint.
Now I try to use Eclipse CDT. I got eclipse-cpp-juno-SR2-linux-gtk.tar.gz but find that I don't know how to load my executable so to start debugging.
I googled with words like 『eclipse debug pre-built C binary』, but few seems to care about this feature.
Can Eclipse CDT really do that? If Eclipse CDT can't, is there any better alternatives to KDbg? Please help.
According to hint from this answer, https://stackoverflow.com/a/248119/151453 , I finally figure out how to do it.
The key point is: In the Eclipse CDT project, create/edit a Launch Configuration so to tell the debugger what executable to load.
Now I have to admit, Eclipse CDT does quite well in C++ code debugging far better than KDbg.
Some screen shot below, on openSUSE 12.3 .
Now we can Run -> Debug (F11)
Debugger automatically pauses the program at main()'s first statement.
The Stand-alone Debugger is an Eclipse application which packages the Eclipse plug-ins from the CDT (C/C++ Development Tools) project into an application that can be started from a command-line script:
bash /path/scripts/cdtdebug.sh -e executable [args]

How can I output execution display to console in Eclipse for remote C++?

I'm using Eclipse 3.4.1 with Hp/UX plugin for remote debugging of C/C++. It works very fine, except for one issue: whenever I compile my projects, the output display is Eclipse's console view, but when I run or debug any projects, the output window is the old and not-so-good MS-DOS command window. I haven't find any way to change this behavior.
How do I set the execution output display to Eclipse console?
Update:
Environment: running Eclipse 3.4.1 on Windows XP and debugging C/C++ applications on an HP/UX server.
CDT version is 5.0.0.
Which version of CDT are you using? Because from this "hello world" guide it seems the spawner.dll pretty much handles this console redirection for you.