all:: program1, program2, program3
CPPFLAGS = -g
g++ -o myprog -g myprog.C
gdb myprog
Command | Action |
---|---|
l | list 10 lines of the program. |
l n | list 10 lines, near line n. |
b n | set a breakpoint at line n. |
b proc_name | break when procedure proc_name is called. |
r | run the program. |
p var | print the value of the variable var. |
s | step to the next instruction, going into procedures. |
n | step to the next line, but don't go into procedures. |
q | quit the program. |