under the directory of the project, create file .gdbinit
write the "set follow-fork-mode child"
then you can debug the child process