Gdb with error 193 when debugging compiled MinGW code

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

alt text

Then I tried to manually create a simple Hello World program using Notepad ++ and the gcc command line. When I launched the GDB debugger, this happened:

(Gdb) run

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

The binary works fine, but as soon as I try to debug it, error 193 is returned. I work with C code that is processed by the MinGW GCC compiler. I tried reinstalling the compiler and debugger (latest versions), but that didn't change anything. This has worked in the past, and I don’t remember any changes in the settings related to the compiler.

Here is an example of the error log that Eclipse generated.

! ENTRY org.eclipse.cdt.dsf.gdb 4 5012 2010-02-09 18: 19: 47.375! MESSAGE Error in final startup sequence! STACK 1 org.eclipse.core.runtime.CoreException: Failed to execute MI command: - exec-run Error message from debugger server: Error creating process C: / Documents and Settings / Pieter / Mijn documentmenten / My Dropbox / Unief / C /H12/Opdr07/Debug/CH12O07.exe, (error 193). in org.eclipse.cdt.dsf.concurrent.Sequence.abortExecution (Sequence.java∗60) in org.eclipse.cdt.dsf.concurrent.Sequence.access $ 4 (Sequence.java►52) in org.eclipse.cdt . dsf.concurrent.Sequence $ 2.handleErrorOrWarning (Sequence.java:424) in org.eclipse.cdt.dsf.concurrent.RequestMonitor.handleFailure (RequestMonitor.javahaps14) in org.eclipse.cdtur.dll.conf. (RequestMonitor.java:277) in org.eclipse.cdt.dsf.concurrent.RequestMonitor $ 2.run (RequestMonitor.java:239) in java.util.concurrent.Executors $ RunnableAdapter.call (Unknown source) in java.util . concurrent.FutureTask $ Sync.innerRun (unknown source) in java.util.concurrent.FutureTask.run (unknown source) in java.util.concurrent.ScheduledThreadPoolExecutor $ ScheduledFutureTask.access $ 301 (unknown source) in java.rentdu.Exconc. $ ScheduledFutureTask.run (unknown source) on java.util.concurrent.ThreadPoolExecutor $ Worker.runTask (unknown source) on java.util.concurrent.ThreadPoolExecutor $ Worker.run (Unknown source) on java.lang.Thread.run (Unknown a source)! SUBENTRY 1 org.eclipse.cdt.dsf.gdb 4 10004 2010-02-09 18: 19: 47.546! MESSAGE The MI command failed: -exec -run Error message from the debugger server: Error creating process C: / Documents and Settings / Pieter / Mijn documentmenten / My Dropbox / Unief / C / H12 / Opdr07 / Debug / CH12O07.exe, (error 193).

+4
source share
5 answers

Maybe you are either using an older version of gdb, which does not support MinGW's own debugging (unlikely, since you said you upgraded to the latest version), or are you using the debugger incorrectly ? In other words, if your executable is named helloworld.exe , gdb helloworld may give you this error, while gdb helloworld.exe may work.

Edit: googling later said that trying a directory name without spaces could work (a solution for Code :: Blocks, but it doesn’t hurt to try).

+6
source

Google tells me that “Error 193” is a Windows error code, which means that the executable is not actually executable. There seems to be something wrong with your EXE - can you start it right?

+3
source

your shared library option is enabled (perhaps because you switched your project from the executable to the shared library, then back), and gcc is still called with the '-shared' options, but the output file has a .exe extension. IN

there is a flag "shared"
 Properties => C/C++ Build => Settings => Tool Settings => MinGW C Linker => Shared Library Settings. 

Make sure it is not installed. I also had error 193 until I flipped it over.

+3
source

This thread mentions:

  • Error 193 ERROR_BAD_EXE_FORMAT
  • This may be a problem with your cygwin installation.

Note (as an example of a "problem with installing cygwin"): there was an error with gdb if it was installed in cygwin that the path refers to, including a space in it (see this thread )

What version of gdb do you use when playing a problem outside of the Eclipse CDT?

0
source

You said:

(gdb) run

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

Could this have anything to do with the forward / backward slash at the end of the executable path? Perhaps the part of Bureaublad/test.exe here is intended as a single executable file and cannot be found?

0
source

Source: https://habr.com/ru/post/1300739/


All Articles