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
Once in the GDB interpreter run the following:
layout src
run
: Runs the program in it's entirety. Also accepts arguments that would
normally be passed in the command line.
b
: Sets a breakpoint at the given function.
s
: Steps to the next line.
n
: Run until the current function finishes.