libmthread: do not dump stack for free threads
Change-Id: Ic438a252f5bddaf1513f554c71173e6fffb0c674
This commit is contained in:
parent
723e51327f
commit
2af99c141d
1 changed files with 6 additions and 2 deletions
|
@ -122,10 +122,14 @@ void mthread_stacktrace(mthread_thread_t t)
|
|||
mcontext_t *mtx;
|
||||
struct stackframe_s *frame;
|
||||
|
||||
printf("thread %d: ", t);
|
||||
|
||||
tcb = mthread_find_tcb(t);
|
||||
ctx = &tcb->m_context;
|
||||
|
||||
if (t != MAIN_THREAD && ctx->uc_stack.ss_size == 0)
|
||||
return; /* no stack, no stacktrace */
|
||||
|
||||
printf("thread %d: ", t);
|
||||
|
||||
mtx = &ctx->uc_mcontext;
|
||||
frame = &mtx->mc_p_reg;
|
||||
bp = frame->fp;
|
||||
|
|
Loading…
Reference in a new issue