gdb run < file

Christopher Faylor
Thu Jun 28 19:05:00 GMT 2001

I'm sorry but I don't think that this is the correct way to deal with
this.  I think that gdb normally handles things like redirection and
globbing by starting inferior processes via the user's shell.  Then it
uses some kind of "follow fork" method to notice when the process is
finally started.

It just occurred to me that Windows has the capability (check out the
CreateProcess call) to do this so I think it makes sense to use gdb's
standard method for dealing with this problem.

I don't have any specific pointers since I'm not familiar with the code
in question, but I've Cc'ed the gdb mailing list in case someone can
offer advice.

I should point out that you'll need to have an assignment on file with
the FSF for your changes to be officially incorporated into gdb.

I've Cc'ed the person responsible for gdb assignments in this email.


On Wed, Jun 27, 2001 at 11:57:00PM -0700, Tak Ota wrote:
>Since this is the first time for me to look at gdb source it took a
>while to get to the right place to tackle.  Thank to Source Navigator,
>eventually I found win32-nat.c was the one I needed to fix.  The fix
>itself is quite straight forward.
>Please see the patch to win32-nat.c in gdb-20010428-1 at the end of
>this message.  I am not quite satisfied with the argument parsing part
>but at least it fulfills what I wanted.  Please improve it if you have
>better idea.
>However I have verified this works, my testing environment is fairly
>limited.  Please verify it in various different configuration.
>On Wed, 27 Jun 2001 02:50:36 -0400, Christopher Faylor <> wrote:
>> On Tue, Jun 26, 2001 at 11:44:02PM -0700, Tak Ota wrote:
>> >I encountered a problem in gdb.
>> >
>> >(gdb) run < file
>> >
>> >does not change the process stdin to the file.
>> Yep.  That's a limitation in windows gdb.
>> >I just started looking into gdb source code for the first time in my
>> >left.  For now I found top.c has command loop but the size of the code
>> >is so overwhelming.  So I thought reporting the incident first may
>> >solve the problem way before I can find the cause and fix.
>> No one is working on this, currently.  If you can provide a fix it would
>> be appreciated.  I don't know of any easy way to get this functionality,
>> though.

More information about the Gdb mailing list