Stay in bin/ but pass the "-c" option to make so that it switches to ../build first
$ cd ./bin
$ gdb ProjectBinary
(gdb) make -C ../build
You can also create bin/Makefile
that calls the build/Makefile
:
bin/Makefile
.PHONY: all
all:
make -C ../build
(Change spaces to tab at the start of the line that calls make)
Then run:
$ gdb ProjectBinary
(gdb) make