How to load program reading stdin and taking parameters in gdb?

前端 未结 5 859
不知归路
不知归路 2020-11-28 04:25

I have a program that takes input from stdin and also takes some parameters from command line. It looks like this:

cat input.txt > mypr         


        
5条回答
  •  盖世英雄少女心
    2020-11-28 05:09

    If you were doing it from a shell you'd do it like this:

    % gdb myprogram
    gdb> run params ... < input.txt
    

    This seems to work within emacs too.

提交回复
热议问题