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

前端 未结 5 854
不知归路
不知归路 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 04:58

    And if you do not need to debug from the very beginning you can also attach to an already running process by using:

    $ gdb myprogram xxx
    

    where xxx is the process id. Then you do not need to tell gdb the starting arguments.

提交回复
热议问题