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:
hujun5
2025-04-24 08:26:35 +08:00
committed by Alan C. Assis
parent f3f9b7ecae
commit 2a08860a08
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -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);
}
+1 -1
View File
@@ -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