1.g++-G filename (generates a.out debug program)
2.gdb a.out (enter the Debug interface)
3.b+ line number (the file that contains the main function by default); B+filename: Line number (the breakpoint is set in the specified file).
4.info + b (see all breakpoints)
5.D + num (Info b Gets the breakpoint number num), and the delete breakpoint number is Num's breakpoint.
6.P + variable name (print variable value)
7.display + variable name (tracking variable, but the valid range of the variable is invalidated)
8.N Next
9.s entering function body
10.U + line number (debug jumps to selected line)
11.BT (View program Call information)
12.refresh (Use the most, can generate a standard graphical interface, all of your operations can be clearly presented)
13.GDB debugging graphical interface in my blog has introduced, similar to VC inside the debugger, powerful features.
14.Q (Exit GdB)
Some basic operations of GDB debugging