From: Steve Mucci <samsurfer117@gmail.com>
To: gdb-patches@sourceware.org
Subject: CYGWIN file input redirection
Date: Mon, 26 Sep 2016 14:27:00 -0000 [thread overview]
Message-ID: <CABcp_VQmLT=8WdXFQiJ8RohLh3obNnY6MLdEH8OQ0q6bm1PQ0A@mail.gmail.com> (raw)
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?
next reply other threads:[~2016-09-26 12:43 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-26 14:27 Steve Mucci [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CABcp_VQmLT=8WdXFQiJ8RohLh3obNnY6MLdEH8OQ0q6bm1PQ0A@mail.gmail.com' \
--to=samsurfer117@gmail.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox