delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/06/18/19:33:57

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs
Date: Wed, 18 Jun 2003 19:33:38 -0400 (EDT)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: Sam Steingold <sds AT gnu DOT org>
cc: cygwin AT cygwin DOT com
Subject: Re: gdb attach/detach kills the target process
In-Reply-To: <u65n3hu5s.fsf@gnu.org>
Message-ID: <Pine.GSO.4.44.0306181927330.22307-100000@slinky.cs.nyu.edu>
Importance: Normal
MIME-Version: 1.0

On 18 Jun 2003, Sam Steingold wrote:

> run a process in a cygwin window, find out its PID, run gdb in another
> window, attach to that process, then detach from it.
> the target process stops responding as soon as it is attached to.
> detaching changes nothing.
> only after I exit gdb, I get the original window responding, with the
> terminal in raw start (need to do "reset" in bash) and the process that
> gdb attached to dead.
>
> I tested this on python and clisp.

That's the way Windows debugging works -- once you attach to a process,
detaching from it kills the process.  No way around it.  Furthermore, the
process is killed using the Windows APIs, thus no signal ever reaches the
process and no cleanup is performed.

When you attach to the process in gdb, the process is at a breakpoint
(i.e., stopped).  If you wish to continue the process, use the "cont"
command (you may set some breakpoints first if you want).  For more info
use the gdb "help" command.  You can have the process run to completion
inside gdb.  Note that this behavior is the same on other Unix systems.

Also note: many windows processes use threads.  I suggest reading the gdb
manual carefully on how to debug multithreaded programs, in case you
haven't done this already.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha AT cs DOT nyu DOT edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor AT watson DOT ibm DOT com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019