delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/06/15/10:43:51

X-Spam-Check-By: sourceware.org
Date: Thu, 15 Jun 2006 10:43:23 -0400 (EDT)
From: Igor Peshansky <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: Kyle McKay <kjmckay AT qualcomm DOT com>
cc: cygwin AT cygwin DOT com
Subject: Re: GDB Ctrl-C Interrupt Fails WORKAROUND
In-Reply-To: <37FD7E0C-3F61-4EB2-B5A2-9C86C87A45DA@qualcomm.com>
Message-ID: <Pine.GSO.4.63.0606151041340.9601@access1.cims.nyu.edu>
References: <E5AED0BA-EE62-4D97-96CE-8A96D0C0F559 AT qualcomm DOT com> <37FD7E0C-3F61-4EB2-B5A2-9C86C87A45DA AT qualcomm DOT com>
MIME-Version: 1.0
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/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

On Thu, 15 Jun 2006, Kyle McKay wrote:

> On 15 Jun 2006 at 00:44:05 -0400 Christopher Faylor wrote:
> > On Wed, Jun 14, 2006 at 08:29:50PM -0700, Kyle McKay wrote:
> > > If you have ever tried to interrupt a program running under cygwin
> > > gdb, you have probably experienced some frustration.  Especially if
> > > the program was built with -mno-cygwin.
> >
> > No I never have.  In fact I often rely on CTRL-C interrupting the
> > program.  It doesn't matter whether the program is built with
> > -mno-cygwin or not.  In fact, I am sometimes frustrated when I actually
> > want the CTRL-C to be propagated to the program but then I remember
> > about the "handle" command.
> >
> > The only time that I can think of when a CTRL-C would not interrupt a
> > program would be when you're running gdb under a cygwin pty or tty.  But
> > it's usually easy enough not to do that if you are debugging a problem.
>
> I'm happy for you that CTRL-C works for you.  It does not work for me.
>
> I'm almost never running gdb from a genuine DOS command prompt.
> Sometimes via ssh, sometimes via a terminal emulator.  CTRL-C doesn't
> work in those.
>
> Also, if you have "tty" in your CYGWIN variable it doesn't work even
> from a DOS command prompt.

That's what CGF said.

> Finally, it NEVER works no matter what if you are debugging a program
> built with a different compiler such as m$ visual C++.  And, of course,
> you say I have no reason to do that since the debugging symbols will not
> be compatible. However, the m$ visual C++ built program is then loading
> a cygwin/mingw built DLL.  CTRL-C doesn't work in this case to interrupt
> the running program. Although if you are careful you can get breakpoints
> set, but if you change your mind after you start running the program
> again then you're out of luck. That's where the debugbreak utility comes
> in very handy.

Does "kill -INT <cygwin_pid>" work?

> Lacking the ability to interrupt a running program severely limits gdb's
> usefulness.  Fortunately there's a workaround available.

The workaround would be even better if you didn't need a separate program.
How about submitting a patch for Cygwin's "kill" (with a new signal,
SIGDBG or SIGDEBUG)?  CGF, would you consider such a patch?
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_	    pechtcha AT cs DOT nyu DOT edu | igor AT watson DOT ibm DOT com
ZZZzz /,`.-'`'    -.  ;-;;,_		Igor Peshansky, Ph.D. (name changed!)
     |,4-  ) )-,_. ,\ (  `'-'		old name: Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Las! je suis sot... -Mais non, tu ne l'es pas, puisque tu t'en rends compte."
"But no -- you are no fool; you call yourself a fool, there's proof enough in
that!" -- Rostand, "Cyrano de Bergerac"

--
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