2
votes

I have 32 bit Eclipse Neon for C/C++ and installed the basic packages and c++ compiler for 32 bit MinGW. Everything in Eclipse seems to work fine except the debugger. When I tried debugging a simple hello world program, this is what the debugger will show: enter image description here

The project's C/C++ settings->dialect is set to C++11. The debugger just seems to terminate after pressing debug. There is no thread tree and none of the step functions are active. I made sure the "Skip all breakpoints" is unchecked and there is one breakpoint in the image right next to the "cout". I have tried reinstalling both Eclipse and MinGW multiple times already and restarted my computer, but nothing seems to work.

EDIT: Here's a screenshot of the run configuration -> main tab for those who want it.

enter image description here

EDIT 2: A little update, so I added the MinGW bin's file path to Eclipse's Window -> Preferences -> C/C++ -> Build -> Environment variables, and I finally got an error message. enter image description here Also my setup is MinGW 32 bit with 64 bit Eclipse Neon C/C++. My professor along with most of my peers are using this setup and their debugger seem to be working fine, so it's definitely something on my part that's causing this error, but I don't know what.

1
What does this Test.cpp have to do with your project? Are you launching correct executable (launch configuration)? - dbrank0
That was just from another project. It doesn't affect it though, I deleted it and the debugger still does the same thing. The only difference now is that red message in the console doesn't appear anymore. - bitscuit
Did you successfully build debug configuration of HelloWorld.cpp? Are you really debugging debug build of executable (what does your your launch configuration/main tab say)? - dbrank0
I edited the post to add a screen shot of the run configuration -> main tab. Eclipse says the build was successful, it's just the debugging that's not working properly. Would the fact that I only have 64 bit jdk affect it? Should I try to install a 32 bit jdk? - bitscuit
Your launch config seems ok. Your Java version should match Eclipse (and Windows). So probably 64 bit windows / Java & Eclipse. I would try to update mingw. Can you debug this application from command line? (One thing I would try is updating mingw... your debugger is quite old.) - dbrank0

1 Answers

1
votes

Ok, so I don't exactly know what happened, but the debugger works now. I fiddled with the environment variables a bit, and it started working after that. I tried isolating the solution, so I reinstalled Eclipse to see what setting actually fixed the debugger, but after this reinstall the debugger just worked normally unlike the previous times.

For those who have this problem I have a few suggestions on trying to get it to work. All of the suggestions involve adding the MinGW bin path to some environment variable:

  1. Add the MinGW bin path to your Environment variables (the user one or system one or you could try both).
  2. Add the MinGW bin path to your Eclipse's build environment variables (Window -> Preferences -> C/C++ -> Build -> Environment)
  3. Add MinGW bin path to your Run Configurations Environment variables (Run -> Run Configurations -> Environment tab) if it's not already there.
  4. Add the GDB debugger path (should be something like this C:\MinGW\bin\gdb.exe) to your Debug Configurations (Run -> Debug Configurations -> Debugger Tab and in there put the gdb path in GDB debugger).

I don't actually know if this was what fixed the problem. My debugger just started to work after I tried those things (not necessarily in the stated order).