当我尝试在cygwin上使用gdb调试一个简单的程序时,我得到以下内容: C:\Users\Benoit St-Pierre\workspace_cpp\cs454gdb a.exeGNU gdb 6.8.0.20080328-cvs (cygwin-special)Copyright (C) 2008 Free Software Foundation, Inc.Licen
C:\Users\Benoit St-Pierre\workspace_cpp\cs454>gdb a.exe GNU gdb 6.8.0.20080328-cvs (cygwin-special) Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i686-pc-cygwin"... (gdb) start Breakpoint 1 at 0x401a51: file server.cc, line 207. Starting program: /cygdrive/c/Users/Benoit St-Pierre/workspace_cpp/cs454/a.exe Error creating process /cygdrive/c/Users/Benoit St-Pierre/workspace_cpp/cs454/a.exe, (error 193).
错误193是ERROR_BAD_EXE_FORMAT.
编译的应用程序本身运行良好,客户端连接并与应用程序交互.我正在使用cygwin 1.7因为我正在使用新的getaddrinfo方法来设置套接字.使用gcc 3.4.4使用以下命令编译应用程序:
g++ -g3 server.cc
任何人都知道我可能做错了什么?
问题是您的路径名中有空格字符.将文件移动到另一个目录,gdb将能够启动该过程.