cygwin gdb always fails creating process (error 193)

E

edwardzyang

I am running Windows XP with cygwin with gcc 3.4.4-1 and gdb
20060706-2. I compiled this very simple program:

#include <iostream>
using namespace std;

int main(int argc, char (*(argv[])) ) {
int max; // number to count to
if (argc == 1) {
// print to 100
max = 100;
} else {
// convert first argument to integer, print to that
max = atoi(argv[1]);
}
for (int i = 0; i <= max; i++) {
cout << i << "\n";
}
return 0;
}

....using the command:

$ g++ -g -o printNumbers.exe printNumbers.cpp

When I run `gdb printNumbers.exe`, things start off fine:

GNU gdb 6.5.50.20060706-cvs (cygwin-special)
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and
you ar
welcome to change it and/or distribute copies of it under certain
condition
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for
details.
This GDB was configured as "i686-pc-cygwin"...

....but when I actually try to run the executable, I get this error:

(gdb) run
Starting program: ~/C++/exercises/printNumbers.exe
Error creating process ~/C++/exercises/printNumbers.exe, (error 193).

Error 193 is ERROR_BAD_EXE_FORMAT, but this cryptic error code does not
give me much information on how to resolve the problem. Note that
outside the debugger, both inside and outside of cygwin, the program
runs fine.

I have tried compiling the program several times using different
distributions of the g++ compiler (dev-cpp and mingw) inside and
outside of cygwin, but all with the same result. I have also tried
running gdb inside and outside of cygwin.

Running 'g++ -dumpmachine' returns "i686-pc-cygwin", so the
architectures appear to match up and should not pose a problem.

I am confounded, and not having ever used a debugger before (I hail
from PHP) doesn't help very much. Help much appreciated!

P.S. I realize debugging is not directly related to comp.lang.c++,
however, it probably is an essential part of any C++ developer's
toolkit, and also the more relevant gnu.gdb is read-only.
 
G

Gianni Mariani

P.S. I realize debugging is not directly related to comp.lang.c++,
however, it probably is an essential part of any C++ developer's
toolkit, and also the more relevant gnu.gdb is read-only.

Yes - you're way off topic here. This is an issue with your cygwin
installation.

FYI - I can't reproduce your problem. gdb loads the program just fine
on my installation.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top