Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Problems with GDB with Eclipse for C/C++ on Windows(Problems with GDB with Eclipse for C/C++ on Windows)
Problems with GDB with Eclipse for C/C++ on Windows [message #1824396] Tue, 14 April 2020 17:46 Go to next message
Robin Mueller is currently offline Robin MuellerFriend
Messages: 6
Registered: April 2020
Junior Member
Hello,

I am trying to debug a very simple Hello World application with Eclipse IDE for C/C++ Developers Version: 2020-03 (4.15.0).
I tried an own Makefile project and the CDT managed build. In both cases
i get the following errors in dthe debugger. Running works without issues:

Thread #1 0 (Suspended: Error: Command Aborted)

Does anyone have an idea why gdb does not work?

I attached the error and the gdb settings.

Kind Regards
Robin

[Updated on: Wed, 15 April 2020 17:59]

Report message to a moderator

Re: Problems with GDB with Eclipse for C/C++ on Windows [message #1828184 is a reply to message #1824396] Wed, 03 June 2020 12:00 Go to previous messageGo to next message
Robin Mueller is currently offline Robin MuellerFriend
Messages: 6
Registered: April 2020
Junior Member
No one else has this issue? I am now ussing the gdb.exe (C:\msys64\mingw64\bin\gdb.exe) for 64 bit binaries (I thoughtthat might have been a solution), but I still can't use gdb in eclipse because of this issue, but it works from the command line..

[Updated on: Wed, 03 June 2020 12:03]

Report message to a moderator

Re: Problems with GDB with Eclipse for C/C++ on Windows [message #1828190 is a reply to message #1828184] Wed, 03 June 2020 14:03 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
What works from the command line: running the program or running the debugger?
What is in the Debugger Console when this happens?
What were the debug options used during the build?
Is optimization enabled?

Can you supply a small example of this happening so others can attempt to reproduce it?

UPDATE: problem is occurring in NTDLL.
https://www.processlibrary.com/en/directory/files/ntdll/23004/
This looks like a problem with MinGW gdb and not Eclipse.
Googling "ntdll LdrInitShimEngineDynamic mingw gdb" turns up a number of related problems.

[Updated on: Wed, 03 June 2020 14:23]

Report message to a moderator

Re: Problems with GDB with Eclipse for C/C++ on Windows [message #1828288 is a reply to message #1828190] Fri, 05 June 2020 21:04 Go to previous messageGo to next message
Robin Mueller is currently offline Robin MuellerFriend
Messages: 6
Registered: April 2020
Junior Member
Alright , I will look into this.
Running gdb and running the application from the command line the classic way works ,thats what I mean. I can also run the application from eclipse, but there are issues with getting the output from the console as well. (and I dont have that problem from the command line as well).

As you guessed this is not a code specific problem. I get his problem running the most simple C++ program. I suspect it is windows / msys2 related like you said but I am just wondering why I can run gdb from command line and not from eclipse

[Updated on: Fri, 05 June 2020 22:18]

Report message to a moderator

Re: Problems with GDB with Eclipse for C/C++ on Windows [message #1839765 is a reply to message #1828288] Sat, 27 March 2021 23:00 Go to previous messageGo to next message
Anthony Verbeck is currently offline Anthony VerbeckFriend
Messages: 1
Registered: March 2021
Location: Oregon City, Oregon, USA
Junior Member
The basic problem is that gcc and gdb are not from the same release. For whatever reason, gdb is essentially located in two places: it is part of binutils (located at c:\msys64\usr\bin) and part of the 64-bit compiler release (located at c:\msys64\mingw64\bin). The 64-bit gcc compiler is not compatible with the 32-bit (?) gdb located in binutils. This all comes about because make (an independent package) is also located in c:\msys64\usr\bin. Make is required to build Makefile based projects, thus must be on the path. In the past, I believe this was not an issue.

Make sure that the PATH variable is like this: c:\msys64\mingw64\bin;c:\msys64\usr\bin. This can be done as a win10 environment variable or set in the eclipse CDT project environment. Note that the compiler directory is before the make directory. In the current release of msys2, the version of gdb in c:\msys64\usr\bin is not compatible with the gdb that is shipped with the compiler (c:\msys64\mingw64\bin). The order of these directories is critical and ensures that the gcc and gdb come from the same directory. There is an issue opened on msys2 for this, it is: https://github.com/msys2/MSYS2-packages/issues/2361

Hope this helps.
Re: Problems with GDB with Eclipse for C/C++ on Windows [message #1844900 is a reply to message #1824396] Wed, 29 September 2021 09:49 Go to previous message
Michael Dammerer is currently offline Michael DammererFriend
Messages: 1
Registered: September 2021
Junior Member
Solved it by making sure to use gdb from C:\msys64\mingw64\bin instead of C:\msys64\usr\bin.

Right click on Project -> Properties -> "C/C++ Build" -> Environment
Set or add Variable PATH to
${MINGW_HOME}\bin

First directory in list gets priority over other entries in the list. So make sure ${MINGW_HOME}\bin comes before ${MSYS_HOME}\usr\bin if both are required.
Previous Topic:Saving project in different workspace
Next Topic:Risc-V Qemu C cross compile error
Goto Forum:
  


Current Time: Sat Apr 20 14:28:58 GMT 2024

Powered by FUDForum. Page generated in 0.03835 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top