mirror of
https://github.com/apache/nuttx.git
synced 2026-05-10 07:18:49 +08:00
arch/arm64: fix backtrace register access and gdbstub config guard
Fix arm64_backtrace to access TCB register context directly instead of using running_regs(), which may not reflect the actual context being backtraced. Add CONFIG_ARCH_HAVE_DEBUG guard to prevent undefined references in non-debug builds. Signed-off-by: hujun5 <hujun5@xiaomi.com>
This commit is contained in:
@@ -162,8 +162,8 @@ int up_backtrace(struct tcb_s *tcb,
|
||||
{
|
||||
ret = backtrace(tcb->stack_base_ptr,
|
||||
tcb->stack_base_ptr + tcb->adj_stack_size,
|
||||
running_regs()[REG_X29],
|
||||
running_regs()[REG_ELR],
|
||||
(void *)(tcb->xcp.regs)[REG_X29],
|
||||
(void *)(tcb->xcp.regs)[REG_ELR],
|
||||
buffer, size, &skip);
|
||||
}
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ static const struct memory_region_s g_memory_region[] =
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
#if defined(CONFIG_SMP) && defined(CONFIG_ARCH_HAVE_DEBUG)
|
||||
static struct smp_call_data_s g_call_data;
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user