backtrace: use CURRENT_REGS when in interrupt context
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
This commit is contained in:
parent
ade9d39478
commit
e6d2f0623a
@ -140,8 +140,8 @@ int up_backtrace(struct tcb_s *tcb,
|
||||
{
|
||||
ret += backtrace(rtcb->stack_base_ptr,
|
||||
rtcb->stack_base_ptr + rtcb->adj_stack_size,
|
||||
(void *)rtcb->xcp.regs[REG_FP],
|
||||
(void *)rtcb->xcp.regs[REG_PC],
|
||||
(void *)CURRENT_REGS[REG_FP],
|
||||
(void *)CURRENT_REGS[REG_PC],
|
||||
&buffer[ret], size - ret, &skip);
|
||||
}
|
||||
}
|
||||
|
@ -262,7 +262,7 @@ int up_backtrace(struct tcb_s *tcb,
|
||||
ret += backtrace_branch((unsigned long)
|
||||
rtcb->stack_base_ptr +
|
||||
rtcb->adj_stack_size,
|
||||
rtcb->xcp.regs[REG_SP],
|
||||
CURRENT_REGS[REG_SP],
|
||||
&buffer[ret],
|
||||
size - ret, &skip);
|
||||
}
|
||||
|
@ -630,9 +630,9 @@ int up_backtrace(struct tcb_s *tcb,
|
||||
ret = backtrace_unwind(&frame, buffer, size, &skip);
|
||||
if (ret < size)
|
||||
{
|
||||
frame.fp = rtcb->xcp.regs[REG_FP];
|
||||
frame.sp = rtcb->xcp.regs[REG_SP];
|
||||
frame.pc = rtcb->xcp.regs[REG_PC];
|
||||
frame.fp = CURRENT_REGS[REG_FP];
|
||||
frame.sp = CURRENT_REGS[REG_SP];
|
||||
frame.pc = CURRENT_REGS[REG_PC];
|
||||
frame.lr = 0;
|
||||
frame.stack_top = (unsigned long)rtcb->stack_base_ptr +
|
||||
rtcb->adj_stack_size;
|
||||
|
@ -155,8 +155,8 @@ int up_backtrace(struct tcb_s *tcb, void **buffer, int size, int skip)
|
||||
{
|
||||
ret += backtrace(rtcb->stack_base_ptr,
|
||||
rtcb->stack_base_ptr + rtcb->adj_stack_size,
|
||||
(void *)rtcb->xcp.regs[REG_FP],
|
||||
(void *)rtcb->xcp.regs[REG_EPC],
|
||||
(void *)CURRENT_REGS[REG_FP],
|
||||
(void *)CURRENT_REGS[REG_EPC],
|
||||
&buffer[ret], size - ret, &skip);
|
||||
}
|
||||
}
|
||||
|
@ -255,8 +255,8 @@ int up_backtrace(struct tcb_s *tcb, void **buffer, int size, int skip)
|
||||
#endif
|
||||
ret += backtrace_stack(rtcb->stack_base_ptr,
|
||||
rtcb->stack_base_ptr + rtcb->adj_stack_size,
|
||||
(void *)rtcb->xcp.regs[REG_A1],
|
||||
(void *)rtcb->xcp.regs[REG_A0],
|
||||
(void *)CURRENT_REGS[REG_A1],
|
||||
(void *)CURRENT_REGS[REG_A0],
|
||||
&buffer[ret], size - ret, &skip);
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user