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: 101
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 messageGo to next 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).
Re: Debugging with GDB - incorrect path to executable [message #1849589 is a reply to message #1847185] Wed, 26 January 2022 11:36 Go to previous messageGo to next message
manu goswami is currently offline manu goswamiFriend
Messages: 1
Registered: January 2022
Junior Member
Hi Developers,

Nothing works. No solution as above worked except below

I simply replaced gdb with msys gdb

ie. for example

current configuration

... Application Configuration .. Debug .. Debug

GDB Debugger gdb


to

GDB Debugger path to msys gdb (like for example c:\msys\bin\gdb.exe


Re: Debugging with GDB - incorrect path to executable [message #1850349 is a reply to message #1849589] Fri, 25 February 2022 17:47 Go to previous messageGo to next message
Mike Wilson is currently offline Mike WilsonFriend
Messages: 1
Registered: August 2019
Junior Member
I am using arm-linux-gnueabihf-gdb 8.3

and getting error:
Error in final launch sequence:

Failed to execute MI command:
-exec-run
Error message from debugger back end:
Don't know how to run.  Try "help target".
Failed to execute MI command:
-exec-run
Error message from debugger back end:
Don't know how to run.  Try "help target".
Don't know how to run.  Try "help target".
Re: Debugging with GDB - incorrect path to executable [message #1850359 is a reply to message #1850349] Sat, 26 February 2022 18:20 Go to previous message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 721
Registered: August 2014
Senior Member
Are you attempting to use an ARM-Linux native debugger on a Windows machine?


--

Tauno Voipio
Previous Topic:building C/C++ hello world
Next Topic:where and how to tell eclipse to add something to moc?
Goto Forum:
  


Current Time: Sat Jul 02 09:22:40 GMT 2022

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

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

Back to the top