Unable to debug a fork() call properly
<pre><code>int spawn( char* program, char** args) {

    pid_t child_pid;

    child_pid = fork(); 

    if( child_pid!= 0) {  // so this returns if the forking fails? Why would a fork fail?
        return (int)child_pid;
    }

    else {
        execvp(program, args);

        return (int)child_pid;
    }
}
</code></pre>

<p>I have the following code I am trying to debug. The problem is, when the parent calls it the child_pid value in my watchlist is some big number (bigger than zero) but the program itself does go in the else block. 
I want to see how it goes in that else block buy my gdb debugger seems to stop after the child_pid returns its big number </p>