Reputation: 249
I am using the following command to load the c file program and run it in GDB from terminal in one click:
gdb --eval-command='file c.out' --eval-command='c'
I want to sleep some seconds after loading the program but before starting the program in GDB, some thing like:
gdb --eval-command='file c.out' --eval-command='<sleep 5>' --eval-command='c'
Upvotes: 3
Views: 5328
Reputation: 10261
One way to give gdb a command-line option that will make it pause for 5 seconds is to tell it to run the "sleep 5" command in a shell:
--eval-command="shell sleep 5"
Upvotes: 2