Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get Eclipse to give Cygwin's GDB a posix path to the executable?

Tags:

I'm using Eclipse on Windows to program C++ using Cygwin's toolchain. I would like to use it for debugging as well, but my problem is the following:

  • The executable to debug is in a sub-folder of the workspace (pretty standard, I guess) but not of the actual Project from which the executable is built.
  • Eclipse and GDB have different path formats: Eclipse works with Windows paths, whereas GDB works with posix paths. Eclipse knows D:\Path\To\Exe whereas GDB needs /cygdrive/d/Path/To/Exe.
  • Eclipse insists that it can find the executable to debug when I enter the path in the "Debug configurations..." dialog. The "Debug" button is disabled until the path is correct.
  • Eclipse does not seem to take ${workspace_loc} in that particular input box.

Is there some hidden option I don't know about? Have you had the problem before?

What I've tried so far

  • Forcing Eclipse to pass the path I input to GDB --- did not work.
  • Fiddling with source lookup paths and path mappings --- did not work, it's really just for source files.
  • Creating a C++ Project for the output folder where the executable is, so I could have a relative path to the exe inside the project --- did not work.

Things I could still try

  • Use the .gdbinit file to discard the path given by Eclipse and load the real executable with posix paths --- tried that, but not very hard.
  • Specify a wrapper as argument to GDB --- pollutes the root of my workspace.
  • Provide my own plug-in to deal with the case --- adds another piece of code to maintain in another language.