September 2022
Beginner to intermediate
816 pages
21h 18m
English

In this section, we introduce two debugging tools: the GNU debugger (GDB),1 which is useful for examining a program’s runtime state, and Valgrind2 (pronounced “Val-grinned”), a popular code profiling suite. Specifically, we introduce Valgrind’s Memcheck tool,3 which analyzes a program’s memory accesses to detect invalid memory usage, uninitialized memory usage, and memory leaks.
The GDB section includes two sample GDB sessions that illustrate commonly used GDB commands for finding bugs in programs. We also discuss some advanced GDB features, including attaching GDB to a running process, GDB and Makefiles, signal control in GDB, ...
Read now
Unlock full access