Intitialize the frame pointer and return pc of a new process created

in cpu_fork(). This prevents the stack tracer from running past the
end of the stack (only the pc is checked in that case), which became
fatal when db_print_backtrace() was introduced and called outside
of ddb.

Additional testing:	kris
This commit is contained in:
Thomas Moestl 2004-03-23 23:12:02 +00:00
parent 1f4408f321
commit 252cc8f6b2

View file

@ -300,6 +300,8 @@ cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags)
fp->fr_local[0] = (u_long)fork_return;
fp->fr_local[1] = (u_long)td2;
fp->fr_local[2] = (u_long)tf;
/* Terminate stack traces at this frame. */
fp->fr_pc = fp->fr_fp = 0;
pcb2->pcb_sp = (u_long)fp - SPOFF;
pcb2->pcb_pc = (u_long)fork_trampoline - 8;