[patch] fix spurious SIGSEGV faults under Cygwin

Brian Dessent brian@dessent.net
Thu Feb 2 17:42:00 GMT 2006

Dave Korn wrote:

>   I'm having a conceptual difficulty here: Under what circumstances would you expect there *not* to be a debugger attached to the
> inferior to which the debugger is attached?  That's a bit zen, isn't it?

The code in question here runs many times in the normal course of any
Cygwin program -- debugger or no.  The idea behind guarding the call to
OutputDebugString() with "if (being_debugged())" was that the call to
IsDebuggerPresent() was cheaper than the call to OutputDebugString(),
and that a well-behaived, non-debug build of a binary should not
needlessly send tons and tons of nonsense to OutputDebugString unless
it's actually being debugged and there is something there to interpret
the nonsense.


More information about the Cygwin-patches mailing list