From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21048 invoked by alias); 18 Sep 2006 20:49:23 -0000 Received: (qmail 20750 invoked by uid 22791); 18 Sep 2006 20:49:22 -0000 X-Spam-Check-By: sourceware.org Received: from 195.22.55.53.adsl.nextra.cz (HELO host0.dyn.jankratochvil.net) (195.22.55.53) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 18 Sep 2006 20:49:17 +0000 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.13.8/8.13.8) with ESMTP id k8IKnDhD002248 for ; Mon, 18 Sep 2006 22:49:13 +0200 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.13.8/8.13.8/Submit) id k8IKnDUL002246 for gdb-patches@sourceware.org; Mon, 18 Sep 2006 22:49:13 +0200 Date: Mon, 18 Sep 2006 20:49:00 -0000 From: Jan Kratochvil To: gdb-patches@sourceware.org Subject: Re: [patch] Fix attaching to Linux stopped processes Message-ID: <20060918204912.GA1869@host0.dyn.jankratochvil.net> References: <20060917221228.GA17263@host0.dyn.jankratochvil.net> <20060917222622.GA2150@nevyn.them.org> <20060918095331.GA9299@host0.dyn.jankratochvil.net> <20060918131616.GA22307@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060918131616.GA22307@nevyn.them.org> User-Agent: Mutt/1.4.2.2i X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-09/txt/msg00101.txt.bz2 On Mon, 18 Sep 2006 15:16:17 +0200, Daniel Jacobowitz wrote: ... > > Also the patch looks right to me - after `PT_ATTACH' it is appropriate that > > `WSTOPSIG (status)' will report the original signal that stopped process, > > (WSTOPSIG (status) == SIGSTOP) <=> (process was in running/sleeping mode). > > The part I was dubious about was the zero if already stopped by > sigstop. [ see below ] > In any case, I agree. The patch to linux-nat.c is OK to apply. > > I'm not sure about the testcase though :-( I don't think it'll work > without the RH patched kernel, will it? The testcase does not work for kernel.org kernels. And in fast on kernel.org Linux kernels the patch also does not work well as you need to manually "kill -CONT" the process during the attach, moreover gdb will get 'SIGCONT' id afterwards (and leave the process running after detach). (I did not test but) I expect the Red Hat kernels behavior change is due to the new utrace patch from Intel present in Red Hat kernels. It is going to be imported to kernel.org one day changing the current (IMO broken - I may be wrong) kernels behavior. Still I consider the patch to be better than the current behavior but still it is not fully functional, sorry for its submission; going to check the patches on kernel.org kernels next time. Patch update from me possible later. Regards, Jan