fiq_debugger: arm64: fix command bt, show correct call stack

Change-Id: I718bdfb4247e67542ae665572b0438066fd9daab
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
This commit is contained in:
Huibin Hong
2024-03-19 18:22:00 +08:00
committed by Tao Huang
parent ddcea529f5
commit bc24e0b49a

View File

@@ -159,7 +159,6 @@ struct stacktrace_state {
unsigned int depth;
};
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0)
static bool report_trace(void *data, unsigned long pc)
{
struct stacktrace_state *sts = data;
@@ -173,7 +172,6 @@ static bool report_trace(void *data, unsigned long pc)
return sts->depth != 0;
}
#endif
void fiq_debugger_dump_stacktrace(struct fiq_debugger_output *output,
const struct pt_regs *regs, unsigned int depth, void *ssp)
@@ -199,6 +197,11 @@ void fiq_debugger_dump_stacktrace(struct fiq_debugger_output *output,
output->printf(output, "\n");
walk_stackframe(current, &frame, report_trace, &sts);
}
#else
if (!user_mode(regs)) {
output->printf(output, "\n");
arch_stack_walk(report_trace, (void *)&sts, current, (struct pt_regs *)regs);
}
#endif
}
#endif