Base on the gdb manu we can pass argument as gdb --args gcc -02 -c foo.c But how to use makefile instead of gcc I try gdb --args make -f Makefile.test but failed. Please help. Thanks