Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] windows-nat.c: Handle CTRL_BREAK_EVENT in ctrl_c_handler
@ 2009-09-21 15:24 Pierre Muller
  2009-09-21 17:31 ` Eli Zaretskii
  2009-09-21 17:37 ` Daniel Jacobowitz
  0 siblings, 2 replies; 19+ messages in thread
From: Pierre Muller @ 2009-09-21 15:24 UTC (permalink / raw)
  To: gdb-patches

  Using Ctrl-C to interrupt a running application
does not always work nicely because the application
can decide to handle Ctrl-C as a normal character.
  On the contrary, Ctrl-Break always generates a
call to the installed SetConsoleCtrlHandler.
  This patch allows me to interrupt a debuggee
running in another console (with 'set new-console on')
by pressing Ctrl-Break, even, if Ctrl-C has been
transformed by the debuggee as a normal char
using SetConsoleMode API function.



Pierre Muller
Pascal language support maintainer for GDB



2009-09-21  Pierre Muller  <muller@ics.u-strasbg.fr>

	* src/gdb/windows-nat.c (ctrl_c_handler): Also handle
CTRL_BREAK_EVENT.


Index: src/gdb/windows-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/windows-nat.c,v
retrieving revision 1.196
diff -u -p -r1.196 windows-nat.c
--- src/gdb/windows-nat.c	2 Jul 2009 17:21:07 -0000	1.196
+++ src/gdb/windows-nat.c	21 Sep 2009 14:53:38 -0000
@@ -1289,8 +1304,8 @@ ctrl_c_handler (DWORD event_type)
 {
   const int attach_flag = current_inferior ()->attach_flag;
 
-  /* Only handle Ctrl-C event.  Ignore others.  */
-  if (event_type != CTRL_C_EVENT)
+  /* Only handle Ctrl-C and Ctrl-Break events.  Ignore others.  */
+  if (event_type != CTRL_C_EVENT && event_type != CTRL_BREAK_EVENT)
     return FALSE;
 
   /* If the inferior and the debugger share the same console, do nothing as



^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2009-09-30 20:13 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-21 15:24 [RFA] windows-nat.c: Handle CTRL_BREAK_EVENT in ctrl_c_handler Pierre Muller
2009-09-21 17:31 ` Eli Zaretskii
2009-09-22 15:35   ` Pierre Muller
2009-09-22 17:58     ` Eli Zaretskii
2009-09-22 18:05       ` Joel Brobecker
2009-09-22 22:02       ` Pierre Muller
2009-09-26 16:49     ` Eli Zaretskii
2009-09-29  7:29       ` Pierre Muller
2009-09-29 14:15         ` Joel Brobecker
2009-09-29 14:33           ` Pierre Muller
2009-09-30 20:09             ` Christopher Faylor
2009-09-30 20:13               ` Christopher Faylor
2009-09-29 18:55         ` Eli Zaretskii
2009-09-29 21:22           ` Joel Brobecker
2009-09-30  7:42             ` Pierre Muller
2009-09-21 17:37 ` Daniel Jacobowitz
2009-09-21 22:15   ` Christopher Faylor
2009-09-21 22:39     ` Pierre Muller
2009-09-22 15:49       ` Joel Brobecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox