Exercise 20. Advanced Debugging Techniques
I’ve already taught you about my awesome debug macros, and you’ve been using them. When I debug code I use the debug()
macro almost exclusively to analyze what’s going on and track down the problem. In this exercise, I’m going to teach you the basics of using GDB to inspect a simple program that runs and doesn’t exit. You’ll learn how to use GDB to attach to a running process, stop it, and see what’s happening. After that, I’ll give you some little tips and tricks that you can use with GDB.
This is another video-focused exercise where I show you advanced debugging tricks with my technique. The discussion below reinforces the video, so watch the video first. Debugging will be much easier to learn by watching ...
Get Learn C the Hard Way: A Clear & Direct Introduction To Modern C Programming now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.