From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12893 invoked by alias); 10 Apr 2007 21:40:10 -0000 Received: (qmail 12844 invoked by uid 22791); 10 Apr 2007 21:40:03 -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; Tue, 10 Apr 2007 22:39:58 +0100 Received: by ug-out-1314.google.com with SMTP id 75so158157ugb for ; Tue, 10 Apr 2007 14:39:55 -0700 (PDT) Received: by 10.82.153.5 with SMTP id a5mr10127141bue.1176241195378; Tue, 10 Apr 2007 14:39:55 -0700 (PDT) Received: from ?88.210.72.223? ( [88.210.72.223]) by mx.google.com with ESMTP id e9sm2120215muf.2007.04.10.14.39.53; Tue, 10 Apr 2007 14:39:55 -0700 (PDT) Message-ID: <461C0415.6060404@portugalmail.pt> Date: Tue, 10 Apr 2007 21:40: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> <4619748C.5080007@portugalmail.pt> <46199F9C.1060803@portugalmail.pt> <20070410051535.GA11134@ednor.casa.cgf.cx> In-Reply-To: <20070410051535.GA11134@ednor.casa.cgf.cx> Content-Type: multipart/mixed; boundary="------------080304090907030305030208" 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/msg00116.txt.bz2 This is a multi-part message in MIME format. --------------080304090907030305030208 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 522 >> Pedro Alves wrote: >> >> 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. >> Here is the updated patch that removes the call to delete_command. OK? Cheers, Pedro Alves --------------080304090907030305030208 Content-Type: text/x-diff; name="win32_detach.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="win32_detach.diff" Content-length: 857 2007-04-10 Pedro Alves * win32-nat.c (win32_detach): Remove delete_command call. Resume inferior with win32_resume instead of win32_continue. --- gdb/win32-nat.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) Index: src/gdb/win32-nat.c =================================================================== --- src.orig/gdb/win32-nat.c 2007-04-08 12:11:22.000000000 +0100 +++ src/gdb/win32-nat.c 2007-04-10 21:31:02.000000000 +0100 @@ -1775,8 +1775,9 @@ win32_detach (char *args, int from_tty) if (has_detach_ability ()) { - delete_command (NULL, 0); - win32_continue (DBG_CONTINUE, -1); + ptid_t ptid = {-1}; + win32_resume (ptid, 0, TARGET_SIGNAL_0); + if (!DebugActiveProcessStop (current_event.dwProcessId)) { error (_("Can't detach process %lu (error %lu)"), --------------080304090907030305030208--