GDB Cheatsheet

Starting

To get started, compile with the g flag to get debugging information in the resulting binary.

gcc -g -o main main.c library.c header.h

Then use gdb to enter the interpreter.

gdb ./main

TUI Mode

Once in the GDB interpreter run the following:

layout src

Common Commands