GDB Cygwin 不会将输出重定向到文件

GDB Cygwin will not redirect output to file

我有一个名为测试的 "hello World" 项目。 我愿意

gdb测试 r > log.txt

我得到http://whosebug.com/editing-help

(gdb) r > log.txt
Starting program: /usr/bin/test > log.txt
[New Thread 6408.0x1454]
[New Thread 6408.0x1198]
[New Thread 6408.0x1458]
[New Thread 6408.0x1504]
[New Thread 6408.0xef0]
/usr/bin/test: missing argument after 'log.txt'
[Thread 6408.0x1198 exited with code 2]
[Thread 6408.0x1458 exited with code 2]
[Thread 6408.0x1504 exited with code 2]
[Inferior 1 (process 6408) exited with code 02]
(gdb)

我正在使用 GNU gdb (GDB) (Cygwin 7.10.1-1) 7.10.1

怎么了?

在 cygwin 上测试

touch log.txt 
gdb wc
tty log.txt
run cygcheck.out
quit

cat  log.txt
  973  2919 73904 cygcheck.out

如果输出文件不存在,命令 tty 失败,所以 touch