Need some help in debugging the C-Progam.

Hi i want to debug the C program with GDB debugger. I want to debug the program by line by line. I want to debug program like as we debug the program in Turbo-C using the F8. Can any one help me?

I know i have to use single stepping. But i don't know how to use it. Any help can be appreciated..

Thanks in Adv.

compile -g and then get into gdb - example

gcc -g -o myprog myprog.c
gdb myprog
gdb> break main
gdb> r [any command line args go here]
... commands as needed here

the step command step one line at a time, print <variable name> displays a variable.
help lets you see all of the commands.

Thanks Jim.

Could I add one more question to this thread? Let's imagine that we want to debug running process or some kind of deamon. What could I do then?

gdb can attach to a running process,
if I am not mistaken the syntax is:
gdb prog process-number

What about source code, could I also attach it to debugging running process?

Regards