Eclipse cdt/gdb automatic breakpoint on program entry - how to disable? - gdb

I am using eclipse cdt to develop a c++ program. One thing that drives me crazy is that either eclipse cdt or gdb which it uses for debugging break automatically on main method entry. I don't want to break there!
Before I had some problems and had to recreate my project from scratch, I managed to disable this feature (I think) but for the life of me I cannot find it now! Problems seems to be the eight million different places where debug settings can be found in eclipse.
Does anyone know how to disable this?

Go to Run / Debug Configurations / Debugger / Stop on startup at: [main]

Related

CLion Debug not working on Mac

I haven't used CLion in a bit and something is amiss - when I try to debug, breakpoints are not hit. I see the checkmark flash briefly but the program continues to run. Here is a 15 second video showing what happens:
https://youtu.be/txn6W6aSWnM
This project is the vanilla Hello World project with a couple of lines of code added to the main program, and a breakpoint added in the middle.
This is a new Mac - is something misconfigured? Or has something broken in CLion?
Note: This is still happening with 2018.1. I've reported to JetBrains and sent various logs, etc., but still no ability to debug.
I'm using a Mac with the latest version of OSX (10.13.4 as of writing), and also using CLion 2018.1.2. I had this same issue.
The fix was straight forward. Simply go to Tools > CMake > Reset Cache and Reload Project.
ensure the Configuration is the same as the pictureenter image description here
Simply go to Tools > CMake > Reset Cache and Reload Project.
For anyone who ends up here, I was running Clion 2018.1.2 on MacOSX Catalina and had all kinds of problems (specifying GDB vs. LLDB, reseting cache, rebuilding project, etc... nothing worked). I upgraded to Clion 2020.2.1 and debugged the identical project I was having problems with and BAM; breakpoints, variables, stepping into, etc... all worked.

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]

Juno CDT plugin failing to run a C++ application

I have a simple mixed C/C++ application (OpenGL example) which I have successfully built using Eclipse CDT in Juno (MinGW toolchain).
I can run this application fine by hand from a Win7 command console, but it seems to rarely work when running from Eclipse's "Run as" menu. Whether it works or not seems down to seemingly unrelated changes in the code, and I get nothing of interest on the Eclipse run console (just a <terminated> status) even when no code near the start of the application has changed.
I'd like to and it sometimes I can work around this for now, but would be good to get this working if anyone has any ideas - it seems an essential stepping stone to get the debug environment working in Eclipse.
EDIT Side thought - eclipse seems awfully thin on debug diagnostics when something like this fails. If there is any way to turn on more debug I'd welcome the knowledge =)
Resolved - the issue is down to the path being given to the application, or more specifically the OS launcher (so it can find the DLLs it needs).
Even through the default "run" config claims to inherit the parent environment, it doesn't seem to get the same environment as the Win7 command console. I had to manually edit the "Run as" config in Eclipse to have a custom PATH environment variable containing the directories I needed (MinGW/bin, and a directory containing some custom DLLs).
Cheers, Iso

Why does Eclipse default to debug mode whenever I make a new C++ project?

I am about to break something... or pull my hair out...
I just installed:
Eclipse SDK Ver 3.7.2 (Indigo)
CDT
MinGW
I have those two so that I can start to develop C++ on my machine, which is using Windows-XP 32-bit.
Anyway, I got a simple hello-world up and running, and all is peachy... BUT, the problem I have noticed is that everytime I make a new C++ project, it starts it off under Debug mode. I do not know how or why this is, I have gone through just about every option I can see on the menus.
I also do not know how to quickly switch between the modes, and maybe this is hurting me as well, since I am new to Eclipse.
What I want is simple:
Start Eclipse.
Make a new C++ project.
Hit build.
Hit run. (The play button)
Have it run as a release.
"Do something(?)" to switch to debug mode.
Put a breakpoint somewhere.
Hit build.
Hit debug button (the cockroach)
Have me stop over lines of code.
This will cause my hair to remain on my head.
Just for context, my end goal here is Eclipse-As-IDE -> MinGW-as-Cplusplus_compliler -> OpenCV
Thanks in advance!
I'd say the reason for starting in debug mode is that every bigger project will take time, testing and "debugging" to get to a stage where it is ready to be "released". Therefore it defaults to debug.
You can however quickly change to release mode by right-clicking on the project:
Build Configurations->Set Active->Release
For most small projects it doesn't matter what you set. When you get to bigger projects, linking to different libraries depending on whether you are debugging or building for a release, you'll be taking the time to set different parameters in eclipse for different configurations.