kernel: limit stacktrace depth to 50.

- Unlikely to discard useful information and avoids long
    system lockups on machines configured to print system output to serial.
This commit is contained in:
Ben Gras 2010-11-02 21:27:04 +00:00
parent 3c6274b8be
commit 515e8d075f

View file

@ -251,6 +251,7 @@ PUBLIC void proc_stacktrace(struct proc *whichproc)
{
reg_t v_bp, v_pc, v_hbp;
int iskernel;
int n = 0;
v_bp = whichproc->p_reg.fp;
@ -279,6 +280,8 @@ PUBLIC void proc_stacktrace(struct proc *whichproc)
break;
}
v_bp = v_hbp;
if(n++ > 50)
break;
}
printf("\n");
}