5
votes

This is shown when I try to debug my code with Eclipse:

alt text

I then tried creating a simple Hello World program manually with Notepad++ and the command-line gcc. When I launched the gdb debugger this happened:

(gdb) run

Starting program: C:\Documents and Settings\Pieter\Bureaublad/test.exe Error creating process C:\Documents and Settings\Pieter\Bureaublad/test.exe, (error 193).

The binary runs fine, but as soon as I try to debug it error 193 is returned. I'm working with C code that is processed by the MinGW GCC compiler. I tried reinstalling both the compiler and the debugger (latest versions) but that didn't change anything. It has worked in the past, and I do not remember making any changes to settings related to the compiler.

Here's an example of an error log as it was generated by Eclipse.

!ENTRY org.eclipse.cdt.dsf.gdb 4 5012 2010-02-09 18:19:47.375 !MESSAGE Error in final launch sequence !STACK 1 org.eclipse.core.runtime.CoreException: Failed to execute MI command: -exec-run Error message from debugger back end: Error creating process C:/Documents and Settings/Pieter/Mijn documenten/My Dropbox/Unief/C/H12/Opdr07/Debug/CH12O07.exe, (error 193). at org.eclipse.cdt.dsf.concurrent.Sequence.abortExecution(Sequence.java:560) at org.eclipse.cdt.dsf.concurrent.Sequence.access$4(Sequence.java:552) at org.eclipse.cdt.dsf.concurrent.Sequence$2.handleErrorOrWarning(Sequence.java:424) at org.eclipse.cdt.dsf.concurrent.RequestMonitor.handleFailure(RequestMonitor.java:314) at org.eclipse.cdt.dsf.concurrent.RequestMonitor.handleCompleted(RequestMonitor.java:277) at org.eclipse.cdt.dsf.concurrent.RequestMonitor$2.run(RequestMonitor.java:239) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) !SUBENTRY 1 org.eclipse.cdt.dsf.gdb 4 10004 2010-02-09 18:19:47.546 !MESSAGE Failed to execute MI command: -exec-run Error message from debugger back end: Error creating process C:/Documents and Settings/Pieter/Mijn documenten/My Dropbox/Unief/C/H12/Opdr07/Debug/CH12O07.exe, (error 193).

5
What does the "Show Error Log" show? I would advise avoiding spaces in paths with MinGW.Clifford
I added an error log extract above.Pieter
Also, I have in the past been able to compile code that was stored in directories with spaces in their names.Pieter

5 Answers

6
votes

Could it be that either you are using an older version of gdb, that doesn't support native MinGW debugging (unlikely since you said you updated to the latest version), or you are invoking the debugger incorrectly? In other words, if your executable is named helloworld.exe, gdb helloworld may give you that error, whereas gdb helloworld.exe may work.

Edit: further googling says that trying a directory name without spaces might work (the solution is for Code::Blocks, but it doesn't hurt to try).

3
votes

Google tells me that "Error 193" is a Windows error code that means an executable is not, in fact, executable. Looks like there's something wrong with your EXE - can you start it directly?

3
votes

your shared library setting got turned on (probably because you switched your project from an executable to a shared library, then back) and gcc is still being called with the '-shared' options, but the output file has the .exe extension. There is a checkbox called 'shared' in

Properties => C/C++ Build => Settings => Tool Settings => MinGW C Linker => Shared Library Settings.   

Make sure it's not checked. I had also error 193 until I flipped this off.

0
votes

This thread does mention:

  • Error 193 is ERROR_BAD_EXE_FORMAT
  • this can be an issue with your cygwin installation.

Note (as an example of "problem with cygwin installation): there was a bug with gdb if installed in a cygwin referenced with a path including a space in it (see this thread)

What version of gdb are you using when you reproduce the issue outside of Eclipse CDT?

0
votes

You said:

(gdb) run

Starting program: C:\Documents and Settings\Pieter\Bureaublad/test.exe Error creating process C:\Documents and Settings\Pieter\Bureaublad/test.exe, (error 193).

Might it have anything to do with the forward/reverse slash at the end of the executable path? Perhaps the part Bureaublad/test.exe is here intended as a single executable, and it can't be found?