Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] windows-nat.c: Enable processed input at startup
@ 2010-04-26 11:41 Pierre Muller
  2010-04-26 14:32 ` Christopher Faylor
  0 siblings, 1 reply; 6+ messages in thread
From: Pierre Muller @ 2010-04-26 11:41 UTC (permalink / raw)
  To: gdb-patches

  This is the patch I was talking about in
a reply to this thread:
http://sourceware.org/ml/gdb/2010-04/msg00113.html

  It ensures that at startup, if GDB can connect to the console
the console mode is modified to enable processed input.
  This make '^C' (ascii #3) to be interpreted as a 
control event.




Pierre Muller
Pascal language support maintainer for GDB


2010-04-26  Pierre Muller  <muller@ics.u-strasbg.fr>

	* windows-nat.c (_initialize_windows_nat): Try to set
	ENABLE_PROCESSED_INPUT for console mode if accessible.

Index: windows-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/windows-nat.c,v
retrieving revision 1.208
diff -u -p -r1.208 windows-nat.c
--- windows-nat.c	16 Apr 2010 07:49:35 -0000	1.208
+++ windows-nat.c	26 Apr 2010 11:33:08 -0000
@@ -2356,6 +2356,22 @@ void
 _initialize_windows_nat (void)
 {
   struct cmd_list_element *c;
+  HANDLE std_in_handle;
+
+  /* Try to enable processed input for the console.
+     This should allow to use '^C' to interrupt the debuggee
+     at least as log as the debugge does not modify the
+     console mode settings.  */
+  std_in_handle = CreateFile ("CONIN$", GENERIC_READ | GENERIC_WRITE,
+			      FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0);
+
+  if (std_in_handle != INVALID_HANDLE_VALUE)
+    {
+      DWORD console_mode;
+      CHECK (GetConsoleMode (std_in_handle, &console_mode));
+      console_mode = console_mode | ENABLE_PROCESSED_INPUT;
+      CHECK (SetConsoleMode (std_in_handle, console_mode));
+    }
 
   init_windows_ops ();
 


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

end of thread, other threads:[~2010-04-26 18:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-26 11:41 [RFA] windows-nat.c: Enable processed input at startup Pierre Muller
2010-04-26 14:32 ` Christopher Faylor
2010-04-26 15:07   ` Pierre Muller
2010-04-26 15:20     ` Christopher Faylor
2010-04-26 15:47       ` Pierre Muller
2010-04-26 18:24         ` Christopher Faylor

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