Hi Ranjith,
You can use -x option and link a command file which will take
commands from the input file
open a new file:
Then type the commands you want to give input to gdb
tar simulator
load
b main
r
info reg
c
q
then call gdb -x option
[nagaraju@nagaraju nagaraju]$ gdb a.out -x gdb.cmd
Good luck,
Nagaraju M