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]

GDB Interrupts on Cygwin


When running a Windows application from GDB, GDB gives control to the
application at a certain point.  It would be nice to, at an arbitrary
time, suspend the application and give control back to GDB.  I know
that I can set breakpoints, but sometimes I don't know exactly when I
want to break until after I'm running the application.  Ctrl-C
supposedly sends the SIGINT signal to GDB, breaking the running
application and restoring control to GDB.  However, this does not
appear to work, at least not on Cygwin.

I've tried /bin/kill -f -s SIGINT pid.  Sending SIGINT, or in fact any
other signal, simply terminates the Windows application.

I even wrote a simple program to suspend the Windows application at my
command using the Win32 API function SuspendThread.  While the program
does indeed suspend, GDB remains locked.

Perhaps there is some way to, using the Windows API, simulate a SIGINT
signal, or another signal to break the program (perhaps SIGSEGV would
be easiest).  Perhaps GDB could be modified in some way--it could map
Windows messages to UNIX signals.  Or maybe it could look for
keystrokes using Windows hooks rather than its current method (I'm not
even entirely sure what its current method is).  If anyone thinks any
of these methods would be feasible, I would be happy to contribute
code.

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


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