Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Debugging with GDB - incorrect path to executable
Debugging with GDB - incorrect path to executable [message #1834836] Wed, 18 November 2020 19:32 Go to next message
Andrew Johnson is currently offline Andrew JohnsonFriend
Messages: 2
Registered: November 2020
Junior Member
I've installed Eclipse 2020-09, with Cygwin64 and packages gcc-core 10.2.0-1; gcc-g++ 10.2.0-1. This is on a Windows 10 VM running on MacOS.

I have a very simple helloworld program which compiles and runs in Eclipse, outputting "hello world!" on the console. When I try to debug this, I get a gdb error which I can't fathom:

"failed to execute MI command: -exec-run .... Error creating process: /cygdrive/c/eclipse/C:/Users/andrewjohnson/eclipse-workspace/HelloWorld/C:/Users/andrewjohnson/eclipse-workspace/HelloWorld/Debug/HelloWorld.exe, (error 2)."

Error 2 is a Windows code relating to file not found I believe. Not surprising given that path!

If I run If I run gdb from the command line in the HelloWorld\Debug directory - gdb .\HelloWorld.exe - it works fine and I get "hello world!" output.

I can't work out how Eclipse is building that path to pass to GDB. I do have a Path Mapping set in Source Lookup Path /cydrive/c -> C:\ (although I get that incorrect path generated irrespective).

What's being generated looks like a concatenation of Cygwin_Home, eclipse, CWD or PWD and the project executable. I'm pretty new to this so I've run out of ideas of what to check: it must be a configuration issue with Eclipse that I'm missing so if anyone can help I'd really appreciate it.

thanks
Re: Debugging with GDB - incorrect path to executable [message #1834866 is a reply to message #1834836] Thu, 19 November 2020 11:51 Go to previous messageGo to next message
Andrew Johnson is currently offline Andrew JohnsonFriend
Messages: 2
Registered: November 2020
Junior Member
I downgraded gdb v10.1-1 (sorry, I didn't post that information in the original post) to V8.3.1-1 and it works fine. Obviously Eclipse isn't ready to play with V10 yet.
Re: Debugging with GDB - incorrect path to executable [message #1844432 is a reply to message #1834866] Mon, 13 September 2021 23:39 Go to previous messageGo to next message
Vladimir Grishchenko is currently offline Vladimir GrishchenkoFriend
Messages: 100
Registered: July 2009
Senior Member
9.2-1 worked for me with Cygwin, gdb 10.2 works with MinGW however.
Re: Debugging with GDB - incorrect path to executable [message #1847185 is a reply to message #1834836] Mon, 18 October 2021 14:38 Go to previous messageGo to next message
Dirk Osswald is currently offline Dirk OsswaldFriend
Messages: 1
Registered: October 2021
Junior Member
Hi,

I can confirm this behaviour.
Eclipse 2021-03 / 4.19 with CDT 10.2.0 does not work with latest cygwin gdb 10.2.0 on

Error in final launch sequence:

Failed to execute MI command:
-exec-run
Error message from debugger back end:
Error creating process /cygdrive/c/ti/ccs1100/ccs/eclipse/C:/Users/r001483/workspace_v11/ccs11_cygwin_managed/C:/Users/r001483/workspace_v11/ccs11_cygwin_managed/Debug/ccs11_cygwin_managed.exe, (error 2).
Failed to execute MI command:
-exec-run
Error message from debugger back end:
Error creating process /cygdrive/c/ti/ccs1100/ccs/eclipse/C:/Users/r001483/workspace_v11/ccs11_cygwin_managed/C:/Users/r001483/workspace_v11/ccs11_cygwin_managed/Debug/ccs11_cygwin_managed.exe, (error 2).
Error creating process /cygdrive/c/ti/ccs1100/ccs/eclipse/C:/Users/r001483/workspace_v11/ccs11_cygwin_managed/C:/Users/r001483/workspace_v11/ccs11_cygwin_managed/Debug/ccs11_cygwin_managed.exe, (error 2).


Its clear why the launch fails - the executable is searched in a path with cygwin and windows parts weirdly intermangled.
Re: Debugging with GDB - incorrect path to executable [message #1847401 is a reply to message #1847185] Tue, 26 October 2021 02:08 Go to previous message
David Mueller is currently offline David MuellerFriend
Messages: 1
Registered: October 2021
Junior Member
Confirming what Dirk saw; I get the same error, with intermangled paths.

This is on Eclipse 2021-09 RC1 (4.21.0 RC1) with CDT 10.4.0 and Cygwin gdb 10.2-1.

Rolling Cygwin gdb back to 9.2-1 fixes the problem.

Error in final launch sequence:

Failed to execute MI command:
-exec-run
Error message from debugger back end:
Error creating process /cygdrive/c/WINDOWS/system32/C:/Users/David/Desktop/AllProjects/SelectProject/C:/Users/David/Desktop/AllProjects/SelectProject/SelectProject.exe, (error 2).
Failed to execute MI command:
-exec-run
Error message from debugger back end:
Error creating process /cygdrive/c/WINDOWS/system32/C:/Users/David/Desktop/AllProjects/SelectProject/C:/Users/David/Desktop/AllProjects/SelectProject/SelectProject.exe, (error 2).
Error creating process /cygdrive/c/WINDOWS/system32/C:/Users/David/Desktop/AllProjects/SelectProject/C:/Users/David/Desktop/AllProjects/SelectProject/SelectProject.exe, (error 2).
Previous Topic:How to calibrate a simulation without teleports
Next Topic:Link external code from folder C++
Goto Forum:
  


Current Time: Wed Dec 01 10:19:33 GMT 2021

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

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

Back to the top