This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Debugging sub-processes with gdb


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]