Favourite GDB developers tricks
summary
Claim that GDB is usually faster than printf debugging and demonstrate concrete commands: set a breakpoint at line 10 with B 10 then run and use p/type to inspect variables and ptype for struct layouts; use watch to stop on writes and see old/new values, use drprintf to print at a breakpoint, and disable/enable numbered breakpoints. Show saving breakpoints to a file, define a show_bt user command that logs a backtrace to a file, and a small Python API command "hello-python" example. Demonstrate Valgrind integration where Valgrind sends a trap for an uninitialized-value conditional and GDB inspects flags and queries Valgrind.
AI-written summary · about
chapters (14)
- 0:00Introduction
- 1:04GDB setup and breakpoints
- 2:29Advanced breakpoints
- 4:18Breakpoints and watchpoints
- 6:52Hardware vs software watchpoints
- 7:57GDB help and obscure commands
- 9:00Info commands and types
- 9:44Memory inspection with X
- 10:29Auto-display variables
- 11:14Temp breakpoints and continue
- 12:00Source listing and UDFs
- 13:47Python API for GDB
- 15:11Valgrind with GDB
- 17:22Conclusion
related talks
01h 29mMore GDB wizardry and 8 other essential Linux application debugging tools
58m“Debugging Linux C++”
01h 10mCool New Stuff in GDB 9, 10 and 11
25mDebugging memory issues with Valgrind and GDB
01h 29mModern Linux C++ Debugging Tools - Under the Covers
40mMulticore Debugging with GDB
38mProgrammable debuggers and the Linux kernel (drg...
51mDebugging Go programs with Delve
