libmthread: do not dump stack for free threads
Change-Id: Ic438a252f5bddaf1513f554c71173e6fffb0c674
This commit is contained in:
parent
723e51327f
commit
2af99c141d
@ -122,10 +122,14 @@ void mthread_stacktrace(mthread_thread_t t)
|
|||||||
mcontext_t *mtx;
|
mcontext_t *mtx;
|
||||||
struct stackframe_s *frame;
|
struct stackframe_s *frame;
|
||||||
|
|
||||||
printf("thread %d: ", t);
|
|
||||||
|
|
||||||
tcb = mthread_find_tcb(t);
|
tcb = mthread_find_tcb(t);
|
||||||
ctx = &tcb->m_context;
|
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;
|
mtx = &ctx->uc_mcontext;
|
||||||
frame = &mtx->mc_p_reg;
|
frame = &mtx->mc_p_reg;
|
||||||
bp = frame->fp;
|
bp = frame->fp;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user