From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26868 invoked by alias); 26 Sep 2016 12:43:50 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 26855 invoked by uid 89); 26 Sep 2016 12:43:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=studies, amateur, HX-Gm-Message-State:AE9vXwM, fortunately X-HELO: mail-oi0-f50.google.com Received: from mail-oi0-f50.google.com (HELO mail-oi0-f50.google.com) (209.85.218.50) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 26 Sep 2016 12:43:39 +0000 Received: by mail-oi0-f50.google.com with SMTP id r126so204912688oib.0 for ; Mon, 26 Sep 2016 05:43:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=o8Z5s3O6mEHp47EZpN1bWNIDjKldNNqmXuiOsqRm6aQ=; b=OrMhmqXoRIUjgOcFv451Z8Jgf0QVoZ/tEmSqBajBV/pXX244txS5pebWjwg2L3kflM s3dtJN8CUzT0bFvQ0vX10OLBO55PmBTKrjQwEvrXZPRu369tcQb/Dcvxb8yCYvsbOtyG YWl/xTrOQAHEnfGdwC65IDBIhyY1brArqwuOakszuhHhwXCGBkO2EFGJbIRm679FaBIS DWAx82Sazb2TNuyso+4pb3XZi7YnKjAaZ3FtpmDHpX0ZuacmEZzbJqQAUrN68ph2eyRP rXV44EumV1AAYxMSLG6IB04DrA/vQMNFljQNUSBaU5mMHNcUhynVlcQt23iIWqEF14e4 +ANA== X-Gm-Message-State: AE9vXwM+kFsudvLFAGGvKPBrFiHpu0VyFwaOG/lYqQZCG52pZVIHbsub0ASgNJqf9JVeL9SHDXhgxWtBaEsocw== X-Received: by 10.202.95.130 with SMTP id t124mr26191912oib.159.1474893816561; Mon, 26 Sep 2016 05:43:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.202.231.136 with HTTP; Mon, 26 Sep 2016 05:43:36 -0700 (PDT) From: Steve Mucci Date: Mon, 26 Sep 2016 14:27:00 -0000 Message-ID: Subject: CYGWIN file input redirection To: gdb-patches@sourceware.org Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2016-09/txt/msg00335.txt.bz2 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?