Linux application Development-gdb debugging a gdb concept
GDB is the GNU-developed Linux debugging tool
Two basic use Process
1 Entering the debugger mode: Gcc-g test.c-o test.out
2 opening gdb:gdb Test.out
3 Running the program: Run (R)
4 exit: Quit (q)
5 You can also go to gdb before you execute file load to debug files
Three basic commands
1 setting Breakpoints: Break (b) line number or breaking (b) file name: line number items for multiple C files
2 Viewing Breakpoints: info break or I D
3 Delete breakpoint: Delete (d) Number of breakpoint
4 stepping does not enter child functions: Next (N)
5 stepping into the sub-function: Step (s)
6 continuing the execution of the program, not only stepping: Continue (c)
7 Print the value of a variable: print num or P num or print function value print fun
8 Set the value of the variable: set var = value
9 Viewing programs: List (L)
10 loading the executable file to be debugged: file test.c
11 terminating the program being debugged: Kill test.c
12 viewing the type of variable: Whatis num
13 Do not exit GDB re-generate executable file: Make
14 Do not exit GDB execution shell command: Shell
15 Exit Gdb:quit (q)
Linux Application Development-gdb debugging