Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* CYGWIN file input redirection
@ 2016-09-26 14:27 Steve Mucci
  2016-09-30 14:06 ` Eli Zaretskii
  0 siblings, 1 reply; 11+ messages in thread
From: Steve Mucci @ 2016-09-26 14:27 UTC (permalink / raw)
  To: gdb-patches

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?


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

end of thread, other threads:[~2016-10-29 15:11 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-26 14:27 CYGWIN file input redirection Steve Mucci
2016-09-30 14:06 ` Eli Zaretskii
2016-10-15 11:33   ` Eli Zaretskii
2016-10-15 12:40     ` Eli Zaretskii
2016-10-22  9:31       ` Eli Zaretskii
2016-10-24 12:36         ` Pedro Alves
2016-10-24 13:24           ` Eli Zaretskii
2016-10-24 13:43             ` Pedro Alves
2016-10-29  9:55               ` MS-Windows file input redirection, v2 Eli Zaretskii
2016-10-29 15:06                 ` Pedro Alves
2016-10-29 15:11                   ` Eli Zaretskii

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