Mysterious gdb behavior.

Samuel samuel@socal.rr.com
Tue Jul 30 02:09:00 GMT 2002


----- Original Message -----
From: "Paul Derbyshire" <derbyshire@globalserve.net>
To: <cygwin@cygwin.com>
Sent: Friday, July 26, 2002 6:23 PM
Subject: Mysterious gdb behavior.
>
> Error: Error creating process <image path>, (error 193)
>
> Then you look at the documentation. There's no documentation of the
> error codes.


Attached is a small Windows console program that will send to standard
output all Windows error messages associated with a Windows error code. It
can be used as-is by redirecting standard output to a file but the program
is intended to just be a sample. I am not sure what would be the most useful
way for CygWin users to use this. Obviously the best solution is for
FormatMessage, as used by this small sample, to be called for Windows error
codes (usually returned by Windows GetLastError function) so that the error
message can be provided with or instead of the error code. In other words,
if FormatMessage is called with 193 as error code, it will return "%1 is not
a valid Win32 application" where %1 will be the exe file.

Well I just executed a compiled version of the program and the output is not
perfect so perhaps this can only be used as a sample. The important thing is
that it shows how FormatMessage can be used.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: WinErrors.cpp
Type: application/octet-stream
Size: 1113 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20020730/bbbde988/attachment.obj>
-------------- next part --------------
--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


More information about the Cygwin mailing list