Jonathan Adams wrote:

>
>
>As part of a panic, the panicking CPU cross-calls the other CPUs, inducing
>them to call panic_idle().  In panic_idle(), the stack pointer is stored
>in the thread's t_pcb field.  Something like:
>
>       addr::print kthread_t t_pcb.value[1] | $C
>
>(where addr is the active thread on the CPU) might get you a stack trace.
>
>  
>
Sorry for late reply.

It should be like:

addr::print kthread_t t_pcb.val[1]

Anyway, you are right, I look into panic_idle's code of x86:

http://cvs.opensolaris.org/source/xref/on/usr/src/uts/i86pc/os/machdep.c#panic_idle

    750 /*
    751  * If we're not the panic CPU, we wait in panic_idle for reboot.
    752  */
    753 static void
    754 panic_idle(void)
    755 {
    756     splx(ipltospl(CLOCK_LEVEL));
    757     (void) setjmp(&curthread->t_pcb);
    758
    759     for (;;);
    760 }


In setjmp function, it saved context info(nonvalatile registers' value) 
into kthread_t t_pcb:

http://cvs.opensolaris.org/source/xref/on/usr/src/lib/libc/i386/gen/setjmp.s#53

It's enough to find stack of kthread on  other CPU.

Thank you very much! :-)


-- 
Cheers,

----------------------------------------------------------------------
Oliver Yang | OPG Engineering Operation | Oliver.Yang at Sun.COM | x82229


Reply via email to