From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3189 invoked by alias); 8 Mar 2009 19:32:52 -0000 Received: (qmail 3181 invoked by uid 22791); 8 Mar 2009 19:32:51 -0000 X-Spam-Check-By: sourceware.org Received: from pool-173-76-42-111.bstnma.fios.verizon.net (HELO cgf.cx) (173.76.42.111) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 08 Mar 2009 19:32:43 +0000 Received: from ednor.cgf.cx (ednor.casa.cgf.cx [192.168.187.5]) by cgf.cx (Postfix) with ESMTP id 76C0F13C022; Sun, 8 Mar 2009 15:32:33 -0400 (EDT) Received: by ednor.cgf.cx (Postfix, from userid 201) id 6F0472B385; Sun, 8 Mar 2009 15:32:33 -0400 (EDT) Date: Sun, 08 Mar 2009 19:32:00 -0000 From: Christopher Faylor To: gdb-patches@sourceware.org, Oswald Buddenhagen Subject: Re: make attaching to stopped processes work under windows Message-ID: <20090308193233.GA6438@ednor.casa.cgf.cx> Mail-Followup-To: gdb-patches@sourceware.org, Oswald Buddenhagen References: <20090302172305.GK26056@adacore.com> <20090302182826.GA11548@troll08.nokia.trolltech.de> <20090226192552.GB15958@troll08.nokia.trolltech.de> <20090228004414.GA21767@ednor.casa.cgf.cx> <20090226192552.GB15958@troll08.nokia.trolltech.de> <20090302195625.GA16983@troll08.nokia.trolltech.de> <20090303052130.GA28801@ednor.casa.cgf.cx> <20090303120504.GA18244@troll08.nokia.trolltech.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090303120504.GA18244@troll08.nokia.trolltech.de> User-Agent: Mutt/1.5.16 (2007-06-09) 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: 2009-03/txt/msg00101.txt.bz2 On Tue, Mar 03, 2009 at 01:05:04PM +0100, Oswald Buddenhagen wrote: >On Tue, Mar 03, 2009 at 12:21:30AM -0500, Christopher Faylor wrote: >>In my definition of "use case", you don't just theorize that something >>could be done, you explain that "Package X does this all of the time >>because of Y and that makes it hard for me to debug things." You don't >>just assert that you want to change the code because it is >>theoretically possible. >> >well, to me, the idea of being able to attach to a suspended process >seems to have enough merit of its own. after all, why should it matter >whether the process is suspended in the first place? Because you may be debugging a situation where you want precise control over the process's suspend count. The process may be suspended for reasons other than the way that you are specifically using it. For instance, if this code was invoked at the wrong time on a cygwin process it could screw up cygwin's signal handling which tries to (very carefully) use SuspendThread/SetThreadContext/ResumeThread to send signals when running in user code. >anyway, i use that to implement a "debug in separate terminal" mode. >for that, i launch a stub with controlled process flags. that stub >launches the debuggee. for gdb to be able to attach to it without a >race, the debuggee needs to be launched in suspended state. once the >debuggee ends, the stub prints a "enter to continue" message, waits and >terminates. Thank you for explaining. Unfortunately, I am not comfortable accepting this patch as is. I would consider a variation of the patch which implemented either a command line option (assuming that the rest of the gdb developers agree) or a gdb command ("set always-resume-thread on"?) so that this behavior was not the default, however. This would mean that you'd need to have an assignment on file with the FSF so if you are willing to pursue that alternative it would make sense to start that process ASAP. (I'm hoping that someone will provide you with a pointer to the necessary paperwork since I don't have it handy right now) cgf