From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10277 invoked by alias); 10 Apr 2007 05:15:39 -0000 Received: (qmail 10267 invoked by uid 22791); 10 Apr 2007 05:15:38 -0000 X-Spam-Check-By: sourceware.org Received: from pool-72-70-61-13.bstnma.fios.verizon.net (HELO cgf.cx) (72.70.61.13) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 10 Apr 2007 06:15:37 +0100 Received: by cgf.cx (Postfix, from userid 201) id 9062C2B353; Tue, 10 Apr 2007 01:15:35 -0400 (EDT) Date: Tue, 10 Apr 2007 05:15:00 -0000 From: Christopher Faylor To: Pedro Alves , gdb-patches@sourceware.org Subject: Re: [Cygwin] Fix for: detaching crashes the inferior. Message-ID: <20070410051535.GA11134@ednor.casa.cgf.cx> Mail-Followup-To: Pedro Alves , gdb-patches@sourceware.org References: <4618D3F7.3040700@portugalmail.pt> <4619748C.5080007@portugalmail.pt> <46199F9C.1060803@portugalmail.pt> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <46199F9C.1060803@portugalmail.pt> User-Agent: Mutt/1.5.14 (2007-02-12) 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/msg00071.txt.bz2 On Mon, Apr 09, 2007 at 03:06:20AM +0100, Pedro Alves wrote: >Pedro Alves wrote: >>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. >>> > >Here is a new version. > >The real reason for the crashes is that we should be setting >the context back to the inferior, as gdb's copy contains >an adjusted PC. With win32_continue we would resume the >inferior at the wrong address. win32_resume takes care of >that, so the simple fix is to use it when detaching. > >The current code uses delete_command to remove breakpoints, but >that leaves the internal breakpoints behind - not something >we want. Is there a case where we can get to to_detach >without remove_breakpoints being called? I don't think there >is - we always get here through normal_stop, right? >If there isn't, I'll just remove the call to it I'm >introducing in the patch. Are you sure you aren't seeing problems when you attach/detach more than once? I know that there is someplace that isn't getting cleared in that scenario. I have thought that I fixed that problem a few times but it still seems to be there in the latest cygwin release. Anyway, I'd like Corinna to comment on this if possible since that particular piece of code that you're patching is hers, I believe. cgf