Input redirection in gdb (MinGW)

后端 未结 3 1875
广开言路
广开言路 2020-12-03 13:57

I\'m trying to get gdb to run programs with input redirection to stdin. For example, without gdb I would run a program like this:

prog < input.txt
         


        
3条回答
  •  既然无缘
    2020-12-03 14:36

    Input redirection is supported starting with GDB 8.0. From the NEWS file:

    • Native debugging on MS-Windows supports command-line redirection

      Command-line arguments used for starting programs on MS-Windows can now include redirection symbols supported by native Windows shells, such as '<', '>', '>>', '2>&1', etc. This affects GDB commands such as "run", "start", and "set args", as well as the corresponding MI features.

提交回复
热议问题