X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:date:from:to:subject:message-id:reply-to
	:references:mime-version:content-type:in-reply-to; q=dns; s=
	default; b=PEKUgGh3JmM2z3elaYBaqoSTXe62NBQilgZCtJ9nZQCkV3ycStb2L
	zm4ekqHhzpEiR8IgviCUX9Yr3s1c5zZl0zOB+kz2cByOxH1wSx64NZPF7NbSbuhD
	+aZbvncEWksvlgn0MrU4K8pp3gXwuzV0Bfy8WcDN5+Hmv5rJn7C0MU=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:date:from:to:subject:message-id:reply-to
	:references:mime-version:content-type:in-reply-to; s=default;
	 bh=9SnrR9D4VxhM7i/Fgoul709Pfe8=; b=hKoGdSofi4kapu6b1jIprbBMlW1l
	oFA0S2TnK0RtFV+XOafkh1k1ZaUAGuUxE+d7XmLKW1E7v2BhHo+kulbD57p4b2XC
	KIW2EFa//+Tf+tE0S37m7BXWxvLAQZOznsp36bZRWvfshKTsqPEPiKrDcjHzdssd
	3taeNSWxidCSQJo=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-6.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2
X-HELO: mho-02-ewr.mailhop.org
X-Mail-Handler: Dyn Standard SMTP by Dyn
X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information)
X-MHO-User: U2FsdGVkX1/f0PtGNyiSww7O680ef0e4
Date: Wed, 14 May 2014 13:08:50 -0400
From: Christopher Faylor <cgf-use-the-mailinglist-please@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: Debugging sub-processes with gdb
Message-ID: <20140514170850.GC6620@ednor.casa.cgf.cx>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <f5boaz0e6qb.fsf@troutbeck.inf.ed.ac.uk> <20140514152505.GB6620@ednor.casa.cgf.cx> <f5bk39oe5ic.fsf@troutbeck.inf.ed.ac.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <f5bk39oe5ic.fsf@troutbeck.inf.ed.ac.uk>
User-Agent: Mutt/1.5.20 (2009-06-14)

On Wed, May 14, 2014 at 04:36:59PM +0100, Henry S. Thompson wrote:
>Christopher Faylor writes:
>> If you have control over the code you could have it print a pid, wait,
>> and then attach to it with gdb.  That works.
>
>Understood, will do.

I should have mentioned, as an alternative approach, if you're willing
to rebuild the Cygwin DLL, you can configure and build it with
--enable-debugging.  Then you can set an environment variable
CYGWIN_DEBUG=xemacs

That will start a gdb sessions every time Cygwin runs a program
with 'xemacs' in its name.

Be advised however that --enable-debugging adds some check to the cygwin
dll which can slow it down noticeably and, in some rare situations,
introduce some races which cause crashes that you wouldn't see with
the non-debugging variant.

cgf

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

