I am trying to debug a C program which has scanf statements ,using Mingw gdb. I followed this post to compile the program and start the debugger using below commands
gcc -g -o sample sample.c
gdb sample.exe
and created the break point at main using break main
. As my program needs an integer and string as input through scanf, I followed this post and created a file named input , with the contents
1
"InputString"
and run the program using debugger using
run < input
gdb doesn't seem to start the program and gives the following message
Starting program: F:\spoj\sample.exe < input
Don't know how to run. Try "help target".
Please help me understand where I am going wrong.