From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32095 invoked by alias); 10 Apr 2008 15:30:54 -0000 Received: (qmail 31903 invoked by uid 22791); 10 Apr 2008 15:30:52 -0000 X-Spam-Check-By: sourceware.org Received: from host0.dyn.jankratochvil.net (HELO host0.dyn.jankratochvil.net) (89.250.240.59) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 10 Apr 2008 15:30:34 +0000 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.2/8.14.1) with ESMTP id m3AFUJrF005026; Thu, 10 Apr 2008 17:30:19 +0200 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.2/8.14.2/Submit) id m3AFUIV4005025; Thu, 10 Apr 2008 17:30:18 +0200 Date: Thu, 10 Apr 2008 15:37:00 -0000 From: Jan Kratochvil To: Daniel Jacobowitz Cc: Roland McGrath , Doug Evans , GDB Patches , mark.kettenis@xs4all.nl Subject: Re: [patch] Fix Linux attach to signalled/stopped processes Message-ID: <20080410153017.GA4814@host0.dyn.jankratochvil.net> References: <20080401223012.GA14076@host0.dyn.jankratochvil.net> <20080401224936.5F0EC26F8DC@magilla.localdomain> <20080410151545.GC21662@caradoc.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080410151545.GC21662@caradoc.them.org> User-Agent: Mutt/1.5.17 (2007-11-01) 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: 2008-04/txt/msg00193.txt.bz2 On Thu, 10 Apr 2008 17:15:45 +0200, Daniel Jacobowitz wrote: > On Tue, Apr 01, 2008 at 03:49:36PM -0700, Roland McGrath wrote: ... > > As a gdb user, I have long been annoyed by the behavior on attaching to a > > stopped process. What I want is for attach to complete immediately and let > > me examine the process. If I then "cont", the process should go back to > > what it was doing--sitting in job control stop. Then fg or otherwise > > sending SIGCONT will wake it up normally, and gdb should stop and tell me > > about the SIGCONT like normal. > > How could GDB put an attached process back into job control stop? ptrace (PTRACE_DETACH, child_pid, NULL, (void *) (long) SIGSTOP); It is being done by the patch (in the appropriate cases) http://cvs.fedora.redhat.com/viewcvs/*checkout*/rpms/gdb/devel/gdb-6.7-bz233852-attach-signalled-fix.patch (this patch does not follow the Roland's suggested behavior) The current GDB code already interprets the DETACH_COMMAND ARGS parameter as the signal number for PTRACE_DETACH but one cannot enter any arguments for the `detach' command by the cli interface. Regards, Jan