Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backtrace: use CURRENT_REGS when in interrupt context #8192

Merged
merged 1 commit into from
Jan 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions arch/arm/src/common/arm_backtrace_fp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/src/common/arm_backtrace_sp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
6 changes: 3 additions & 3 deletions arch/arm/src/common/arm_backtrace_unwind.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions arch/risc-v/src/common/riscv_backtrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
4 changes: 2 additions & 2 deletions arch/xtensa/src/common/xtensa_backtrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down