Skip to main content



      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 13:46 Go to next message
Eclipse UserFriend
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 13:59] by Moderator

Re: Problems with GDB with Eclipse for C/C++ on Windows [message #1828184 is a reply to message #1824396] Wed, 03 June 2020 08:00 Go to previous messageGo to next message
Eclipse UserFriend
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 08:03] by Moderator

Re: Problems with GDB with Eclipse for C/C++ on Windows [message #1828190 is a reply to message #1828184] Wed, 03 June 2020 10:03 Go to previous messageGo to next message
Eclipse UserFriend
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 10:23] by Moderator

Re: Problems with GDB with Eclipse for C/C++ on Windows [message #1828288 is a reply to message #1828190] Fri, 05 June 2020 17:04 Go to previous messageGo to next message
Eclipse UserFriend
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 18:18] by Moderator

Re: Problems with GDB with Eclipse for C/C++ on Windows [message #1839765 is a reply to message #1828288] Sat, 27 March 2021 19:00 Go to previous messageGo to next message
Eclipse UserFriend
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 05:49 Go to previous message
Eclipse UserFriend
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: Mon Jul 14 16:34:26 EDT 2025

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

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

Back to the top