> gdb --args <executable>
> run
> r
> c
> n
> s
> b <functionName>
> p <variableName>
> kill
You can compile C files into an intermediate representation called object files. These are compiled machine code that hasn’t been put into an executable yet.
When the project is big, this is usually the way to compile since it's faster, first, you compile with object files and then you link them. And it has a huge advantage: Say you modified just one of those C source files—here’s the magic: you only have to rebuild that one object file for that source file! And then you rebuild the executable (fast). All the other C files don’t have to be touched.