From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14615 invoked by alias); 8 Apr 2007 23:03:03 -0000 Received: (qmail 14606 invoked by uid 22791); 8 Apr 2007 23:03:02 -0000 X-Spam-Check-By: sourceware.org Received: from ug-out-1314.google.com (HELO ug-out-1314.google.com) (66.249.92.170) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 09 Apr 2007 00:03:00 +0100 Received: by ug-out-1314.google.com with SMTP id 75so1583178ugb for ; Sun, 08 Apr 2007 16:02:58 -0700 (PDT) Received: by 10.67.50.7 with SMTP id c7mr4816882ugk.1176073378004; Sun, 08 Apr 2007 16:02:58 -0700 (PDT) Received: from ?88.210.74.153? ( [88.210.74.153]) by mx.google.com with ESMTP id y2sm16879146mug.2007.04.08.16.02.53; Sun, 08 Apr 2007 16:02:57 -0700 (PDT) Message-ID: <4619748C.5080007@portugalmail.pt> Date: Sun, 08 Apr 2007 23:03:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pt-BR; rv:1.8.0.10) Gecko/20070221 Thunderbird/1.5.0.10 Mnenhy/0.7.4.0 MIME-Version: 1.0 To: gdb-patches@sourceware.org Subject: Re: [Cygwin] Fix for: detaching crashes the inferior. References: <4618D3F7.3040700@portugalmail.pt> In-Reply-To: <4618D3F7.3040700@portugalmail.pt> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-04/txt/msg00061.txt.bz2 Pedro Alves wrote: > Hi all, > > Detaching on Cygwin often crashes the inferior, either > when gdb attaches to the inferior, or when gdb launches > the inferior as a child. > > Initially I thought that somehow the FLAGS_TRACE_BIT > would be set in the context, and after detaching there would > be no debugger to catch the exception, but it turns out that > it isn't the case - I couldn't find a case where FLAGS_TRACE_BIT > was set. But, surprisingly doing a SetThreadContext with > CONTEXT_CONTROL makes the crashes go away - even if you don't > change the contents of the context. I'm not 100% sure why, but, > it fixes it. If MSFT sends me the Windows sources, I'll look > deeper :) I'm seeing something I missed. There may be a more correct fix. Ignore this patch for now. Cheers, Pedro Alves