This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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]

CYGWIN file input redirection


Hello!
I'm an amateur security researcher, and I mainly work with Windows and
the MinGW/CYGWIN/GoW toolset.

I've found in my studies a confirmed bug in the CYGWIN version of gdb;
http://cygwin.com/ml/cygwin/1999-04/msg00308.html

It states that a command such as;
(gdb)run < input.txt
or
(gdb)args < input.txt
do not work.

I've heard that gdb on Windows creates processes with CreateProcess.
Fortunately from what I've found the STARTUPINFO structure contains
a field for standard input called;

HANDLE hStdInput;

Which would allow for directing standard input to I would assume
anything involving a handle.

Since I've also heard that CYGWIN handles the command line differently
than Linux, there are two files in particular that could be useful in solving
this problem located in the CYGWIN source.

target.c //For Linux command line
windows-nat.c //For Windows command line

Here are the MSDN pages for CreateProcess and STARTUPINFO;

https://msdn.microsoft.com/en-us/library/windows/desktop/ms682425(v=vs.85).aspx
https://msdn.microsoft.com/en-us/library/windows/desktop/ms686331(v=vs.85).aspx

How can we fix this bug?


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