Can any body unfold this sentences related to GDB.
The following are the senteces from one of GDB book .
the red lines need to be concentrated
" If you ask to debug a child process and a vfork is followed by an exec, gdb executes the new target up to the first breakpoint in the new target. If you have a breakpoint set on main in your original program, the breakpoint will also be set on the child process’s main.
When a child process is spawned by vfork, you cannot debug the child or parent until an exec call completes.
If you issue a run command to gdb after an exec call executes, the new target restarts. To restart the parent process, use the file command with the parent executable name as its argument. "
in first para what he says is that in a program if we call fork() next there is exec call then the new child process will run/execute till it find the break point.
is this understading correct.
in second para he says we cannot debug untill exec call completes , i.e exec any way runs on the same PCB so does that mean all break points go and we cannot debug there ?
in third para if we issue the run command after exec , i did not understand here.
any way once we start gdb like gdb a.out next command to execute the program under gdb is run , so why or how can we issue run command after exec
i know it might be very trivial for some guys here but for me a bit confusing.
Help me in understanding this lines.