Debugging With GDB

Run program with arguments:

gdb --args getent passwd xxx

Commands:

break function_name()
start
continue/c (to next breakpoint)
next/n (next line)
enter (repeat the last command)

Compile with -g -ggdb -O0 to have debug symbols and more.