gdb main //debug main
list //view the code, enter to continue. list "function name" to view the function code
break n //set break point on specified line "n"
info breakpoints //view all breakpoints information
disable/clear "breakn" //disable or clear breakpoint "n"
delete //delete all breakpoints
run //run the program
continue //run until next breakpoint or end of the program
next/n //next statement
print i //print variable or statement
quit //quit debug
step //step into
next //step over
finish //step out