Error while launching gdb version Eclipse - c

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.

Related

I have installed MinGW and codelite and everything works except showing "locals" when stoping at a breakpoint when debugging

I have installed recently on my windows 10 the MinGW for using it on C development plus codelite.
Everything works, I can compile and run programs, but I can't find the way to make the debugger show me the value of locals. I am newbie on software development world and I have no idea what can be missing.
I downloaded mingw, installed it for c and c++ languages, added the paths on the environment variables config and then installed codelite, where I could scan the MinGW compiler.
If anyone can guide, I would by highly grateful.
Best regards,

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:

GDB stuck at “Configuring GDB Aborting configuring GDB”

I've installed (OSX Mojave 10.14.6.) Eclipse CDT and GNU MCU Eclipse plugin and finaly GNU Tools for ARM. My goal is to build and debug ARM code using GDB (arm-none-eabi-gdb).
I've created a Hello World project for Arm, which builds ok - but, debugging seems not to work with GDB (that comes with the Arm package). GDB gets stuck:
I have set the proper paths in Eclipse to arm-none-eabi-gdb.
I have signed the arm-none-eabi-gdb (with the same certificate that I used to sign GDB installed via brew into /usr/local/bin/gdb the day before - and it worked!).
I have also tried running Eclipse as root from command line.
Nothing helps.
The message is "Configuring GDB Aborting configuring GDB".
What to do?
Probably what is going on here is that you built to a given target (ARM based) and you're trying to run it (with gdb) on your mac (x86).
You'll need an emulator or QEMU to properly run on your mac or maybe a real board.

Eclipse CDT Debug not in executable format: File format not recognized after strawberry installation

Maybe I'm missing something obvious since I searched the internet for quite a while but could not find a solution for the following problem:
I'm using Eclipse Kepler SP2 (Build id: 20140224-0627) with CDT and MinGW as compiler backend. Debugging C code with gdb worked great up until today (at least I noticed the problem today).
Now I get the following error message when i want to start a progam in the debugger:
Error in final launch sequence
Failed to execute MI command:
-file-exec-and-symbols C:/[...]/Debug/test.exe
Error message from debugger back end:
"C:\[...]\Debug\test.exe": not in executable format: File format not recognized
The program runs nicely and so I thought I might have screwed up some settings. But when I tried to debug an old program, everything worked until I recomplied the old program -> same problem. If I ask the C-wizard to create a new "Hello World" ANSI C application with MinGW, the same problem occurs.
The compile commands which were used are
gcc -O0 -g3 -Wall -c -fmessage-length=0 -o "src\\test.o" "..\\src\\test.c"
gcc -o test.exe "src\\test.o"
I did not update my MinGW in between, but updated Eclipse.
Do you have any pointers on where to look for the problem?
Edit: I just checked the binary type: My old projects are all [x86/le], the newly compiled ones are [amd64/le]. This should be a trace.... Will update posting according to progress.
Edit2: argh I installed strawberry perl a few days ago, and the installer has changed the environment variable MINGW_HOME in origin BUILD SYSTEM to c:\strawberry\c and this screwed up my builds. Resetting it to my c:\MinGW solved the issue.
I'll post this as answer, too. Heading and tags have been updated to point to this issue more directly.
I installed strawberry perl a few days ago, and the installer has changed the environment variable MINGW_HOME in origin BUILD SYSTEM to c:\strawberry\c and this screwed up my builds. Resetting it to my c:\MinGW solved the issue.
BTW: This happened, because strawberry added c:\strawberry\c to the PATH in front of my custom c:\MinGW and eclipse adds those to the BUILD SYSTEM variables.
It should be a parser problem, what is your binary parser under Project/Properties/Build/Settings ?
Check Project->Properties ->C/C++ Build ->environment and path for MINGW_HOME
make sure you have right gdb version (by checking under debug Configuration ->environment).

Resources