Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gdb fails with error 193 when debugging MinGW-compiled code

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).

like image 824
Pieter Avatar asked Feb 09 '10 13:02

Pieter


1 Answers

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).

like image 117
Alok Singhal Avatar answered Oct 31 '22 10:10

Alok Singhal