This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
RE: [patch] fix spurious SIGSEGV faults under Cygwin
- From: "Dave Korn" <dave dot korn at artimi dot com>
- To: <cygwin-patches at cygwin dot com>
- Cc: <gdb-patches at sourceware dot org>
- Date: Thu, 2 Feb 2006 17:47:19 -0000
- Subject: RE: [patch] fix spurious SIGSEGV faults under Cygwin
On 02 February 2006 17:42, Brian Dessent wrote:
> 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.
Um, that's two people now who thought I was referring to the cygwin side of the patch.
No, this is the bit of your post that I was replying to:
"then gdb could simply read that variable in the process' memory before deciding whether to handle the fault. "
Is it the case that IsDebuggerPresent doesn't detect when gdb is attached?
cheers,
DaveK
--
Can't think of a witty .sigline today....