aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorChristopher Faylor <me+cygwin@cgf.cx>1998-04-23 01:26:23 +0000
committerChristopher Faylor <me+cygwin@cgf.cx>1998-04-23 01:26:23 +0000
commitecb3e4a19d3859c23de409a7aea7d80914808635 (patch)
treeec3583375a28c7708098bc3834b2f51d44d0b4a2 /gdb
parent560270b75d0320dd98a0f30530c149d5b3432eda (diff)
downloadgdb-ecb3e4a19d3859c23de409a7aea7d80914808635.zip
gdb-ecb3e4a19d3859c23de409a7aea7d80914808635.tar.gz
gdb-ecb3e4a19d3859c23de409a7aea7d80914808635.tar.bz2
Wed Apr 22 21:17:35 1998 Christopher Faylor <cgf@cygnus.com>
* gdbtk.c (_initialize_gdbtk): add cygwin32 specific code to allow `gdb -nw' to work when specified specified from a windows console-mode command line.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/gdbtk.c27
2 files changed, 33 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 96644d8..6a232ba 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+Wed Apr 22 21:17:35 1998 Christopher Faylor <cgf@cygnus.com>
+
+ * gdbtk.c (_initialize_gdbtk): add cygwin32 specific code to
+ allow `gdb -nw' to work when specified specified from a windows
+ console-mode command line.
+
Wed Apr 22 15:38:56 1998 Tom Tromey <tromey@cygnus.com>
* configure: Rebuilt.
diff --git a/gdb/gdbtk.c b/gdb/gdbtk.c
index 81dda49..78d1518 100644
--- a/gdb/gdbtk.c
+++ b/gdb/gdbtk.c
@@ -3303,4 +3303,31 @@ _initialize_gdbtk ()
init_ui_hook = gdbtk_init;
}
+#ifdef __CYGWIN32__
+ else
+ {
+ DWORD ft = GetFileType (GetStdHandle (STD_INPUT_HANDLE));
+ void cygwin32_attach_handle_to_fd (char *, int, HANDLE, int, int);
+
+ switch (ft)
+ {
+ case FILE_TYPE_DISK:
+ case FILE_TYPE_CHAR:
+ case FILE_TYPE_PIPE:
+ break;
+ default:
+ AllocConsole();
+ cygwin32_attach_handle_to_fd ("/dev/conin", 0,
+ GetStdHandle (STD_INPUT_HANDLE),
+ 1, GENERIC_READ);
+ cygwin32_attach_handle_to_fd ("/dev/conin", 1,
+ GetStdHandle (STD_OUTPUT_HANDLE),
+ 0, GENERIC_WRITE);
+ cygwin32_attach_handle_to_fd ("/dev/conin", 2,
+ GetStdHandle (STD_ERROR_HANDLE),
+ 0, GENERIC_WRITE);
+ break;
+ }
+ }
+#endif
}