Help using gdb for tracing

I've currently started using linux, and am not able to trace the program as in TURBO C using F7 line by line.
I tried google it out and found that can be done using inbuilt debugger(gdb).
but when i enter gdb and type run it just runs the program as it is till the end.
So where should i enter commands like print 'varname' or step. because when I type it after run it says prog1 not running.
Please give me detailed solution as to how to add breakpoints and trace the program line by line checking the value for different variable.
To begin with, before doing the 'run', put a line break where you want to stop the execution by doing 'break <linenumber>'

Once the program reaches that point, type in step to keep moving forward in the program.
Thank you all.
The problem's solved. I also found nice youtube video that explained just as required.
http://www.youtube.com/watch?v=Z6zMxp6r4mc
Topic archived. No new replies allowed.