|
|
|
Re: gdb gets incorrect path from Eclipse [message #1857595 is a reply to message #1857501] |
Thu, 16 February 2023 12:24 |
Hassan Izhar Messages: 6 Registered: January 2023 |
Junior Member |
|
|
It's possible that Eclipse is modifying the system path environment variable when it is launched, which can cause the path to be incorrectly set for other programs like gdb. This can happen if Eclipse is launched with an environment that does not properly initialize the path.
To prevent Eclipse from modifying the system path, you can try setting the path explicitly in your Eclipse launch configuration. To do this, go to Run > Debug Configurations and select your launch configuration. Then, go to the Environment tab and add a PATH variable with the correct value for your system. This should ensure that Eclipse uses the correct path for debugging and other Cygwin programs.
Another option is to manually set the system path environment variable before launching Eclipse, so that Eclipse inherits the correct path. To do this, open the Control Panel and go to System > Advanced system settings > Environment Variables. Then, select the PATH variable in the System variables section and edit it to include the correct path. After making this change, launch Eclipse and verify that the correct path is being used for debugging.
It's worth noting that the behavior you're seeing is specific to your setup and may not be a common issue with Eclipse or gdb. However, these solutions should help to ensure that the path is set correctly for debugging and other Cygwin programs.
|
|
|
|
|
Re: gdb gets incorrect path from Eclipse [message #1866726 is a reply to message #1864897] |
Wed, 05 June 2024 20:40 |
Ralf Streicher Messages: 1 Registered: June 2024 |
Junior Member |
|
|
OMG - I know this topic is stone old....
I use Cygwin on windows and program D:\Desktop\eclipse\src\main.c which gets compiled with the gcc:
#include <stdio.h>
#include <stdlib.h>
int main(void) {
puts("!!!Hello World!!!"); /* prints !!!Hello World!!! */
return EXIT_SUCCESS;
}
But Debugging is not possible as the gdb returns the well know message (partly German, sorry):
Error in final launch sequence:
Failed to execute MI command:
-exec-run
Error message from debugger back end:
Error creating process /cygdrive/d/Desktop/D:/Desktop/eclipse/D:/Desktop/eclipse/Debug/eclipse.exe, (error 2: Das System kann die angegebene Datei nicht finden.)
Failed to execute MI command:
-exec-run
Error message from debugger back end:
Error creating process /cygdrive/d/Desktop/D:/Desktop/eclipse/D:/Desktop/eclipse/Debug/eclipse.exe, (error 2: Das System kann die angegebene Datei nicht finden.)
Error creating process /cygdrive/d/Desktop/D:/Desktop/eclipse/D:/Desktop/eclipse/Debug/eclipse.exe, (error 2: Das System kann die angegebene Datei nicht finden.)
Your message suggests there is a workaround but I do not really undestand the steps. Can you elaborate this a bit more with screenshots or which menus to use in the IDE?
Just as a note: Same behavior is in Visual Code or CodeBlocks, I have not tested whether gdb running on a command line with or without cgdb would have the same problem, but I assume so.
[Updated on: Fri, 07 June 2024 22:29] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03392 seconds