backtrace: use CURRENT_REGS when in interrupt context

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
This commit is contained in:
zhangyuan21 2023-01-04 13:17:31 +08:00 committed by David Sidrane
parent ade9d39478
commit e6d2f0623a
5 changed files with 10 additions and 10 deletions

View File

@ -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);
}
}

View File

@ -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);
}

View File

@ -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;

View File

@ -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);
}
}

View File

@ -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