cygwin gdb always fails creating process (error 193)

Discussion in 'C++' started by edwardzyang@thewritingpot.com, Dec 6, 2006.

  1. Guest

    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.
    , Dec 6, 2006
    #1
    1. Advertising

  2. Re: cygwin gdb always fails creating process (error 193) *OT*

    wrote:
    ....
    >
    > 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.
    Gianni Mariani, Dec 6, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tim Daneliuk
    Replies:
    0
    Views:
    224
    Tim Daneliuk
    Feb 6, 2005
  2. Surendra
    Replies:
    0
    Views:
    499
    Surendra
    Mar 23, 2006
  3. seba
    Replies:
    1
    Views:
    1,430
    mlimber
    Mar 22, 2007
  4. Timothy Madden
    Replies:
    1
    Views:
    1,603
    Timothy Madden
    Sep 17, 2009
  5. Daniel Moore

    [QUIZ] Game of Life (#193)

    Daniel Moore, Feb 20, 2009, in forum: Ruby
    Replies:
    6
    Views:
    122
    Daniel Moore
    Mar 1, 2009
Loading...

Share This Page