Some basic operations for gdb debugging
1.g ++-g filename (generate a. out debuggable Program)
2. gdb a. out (enter the debugging Interface)
3. B + line number (the file containing the main function by default); B + filename: line number (specify the breakpoint in the file ).
4. info + B (view all breakpoints)
5. d + NUM (info B obtains the breakpoint number NUM). Delete the breakpoint number that is the breakpoint of NUM.
6. p + variable name (print variable value)
7. display + variable name (tracking variable, but the effective range of the variable will be invalid)
8. n next step
9. s enter the function body
10. u + line number (debugging jumps to the selected line)
11. bt (view program call Information)
12. refresh (most commonly used, a standard GUI can be generated, and all your operations can be clearly displayed)
13. The gdb debugging GUI is introduced in my blog. Similar to the debugger in vc, it has powerful functions.
14. q (exit gdb)