我试图调试在Emacs用gdb模式的程序。它是用g ++编译的,我正在使用cygwin。我的程序需要一个命令行参数,并且还需要输入从标准输入,这是我从一个文件重定向,像这样:GDB不会接受标准输入重定向在Emacs
program.exe inputFile.dat <otherInput.dat
的问题是,GDB是发送串
"<otherInput.dat"
为命令行参数而不是重定向标准输入。我如何强制gdb重定向stdin?
编辑:
GDB中,我使用的命令:
run inputFile.dat <otherInput.dat
,当我用GDB的emacs之外它不工作,要么。
编辑#2:
DFA指出了一个类似的问题:How to load program reading stdin and taking parameters in gdb?
不幸的是,这个问题是不是为我工作接受的答案......这可能是一个cygwin相关的bug?
重复的[http://stackoverflow.com/questions/455544/how-to-load-program-reading-stdin-and-taking-parameters-in-gdb](http://stackoverflow.com/questions/455544/how-to-load-program-reading-stdin-and-taking-parameters-in-gdb)? – dfa 2009-04-20 17:23:38