i've written two simple programs:
int main(int ac, char **argv ) {
execv( "/home/me/Desktop/execvtest2", argv );
}
and
int main(int ac, char **argv ) {
execv( "/home/me/Desktop/execvtest1", argv );
}
I've compiled them with
gcc -g to the according outputfiles.
I'm running Ubuntu 10.10 using gcc (Ubuntu/Linaro 4.4.4-14ubuntu5.1) 4.4.5.
When I'm debuging the first program with GNU gdb (GDB) 7.2-ubuntu, I can step until the first execv statement, but then the two files just keep running. Even if I set the follow-exec-mode to new, I can't step into the second program.
When I set catch exec, gdb stops at each call to execv (some how without linked source for the second program, and I'm not able to quit gdb, as it kind of hangs!?), but I'm not able to step over the call into the "new" (as exec replaces the process) inferior program.
So how can this be done? There must be a way to step into the new process right? Am I doing something wrong?
Cheers
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…