diff --git a/arch/arm64/core/Kconfig b/arch/arm64/core/Kconfig index 7cca2f7045f..367480015c4 100644 --- a/arch/arm64/core/Kconfig +++ b/arch/arm64/core/Kconfig @@ -154,6 +154,13 @@ config ARM64_ENABLE_FRAME_POINTER and OMIT_FRAME_POINTER. It is automatically enabled when the frame pointer unwinding is enabled. +config ARM64_EXCEPTION_STACK_TRACE + bool + default y + depends on FRAME_POINTER + help + Internal config to enable runtime stack traces on fatal exceptions. + config ARM64_SAFE_EXCEPTION_STACK_SIZE int "The stack size of the safe exception stack" default 4096 diff --git a/arch/arm64/core/fatal.c b/arch/arm64/core/fatal.c index 87e5a2441c6..0dbc13228de 100644 --- a/arch/arm64/core/fatal.c +++ b/arch/arm64/core/fatal.c @@ -195,7 +195,7 @@ static void esf_dump(const z_arch_esf_t *esf) LOG_ERR("x18: 0x%016llx lr: 0x%016llx", esf->x18, esf->lr); } -#ifdef CONFIG_FRAME_POINTER +#ifdef CONFIG_ARM64_EXCEPTION_STACK_TRACE static void esf_unwind(const z_arch_esf_t *esf) { /* @@ -363,9 +363,9 @@ void z_arm64_fatal_error(unsigned int reason, z_arch_esf_t *esf) esf_dump(esf); } -#ifdef CONFIG_FRAME_POINTER +#ifdef CONFIG_ARM64_EXCEPTION_STACK_TRACE esf_unwind(esf); -#endif /* CONFIG_FRAME_POINTER */ +#endif /* CONFIG_ARM64_EXCEPTION_STACK_TRACE */ #endif /* CONFIG_EXCEPTION_DEBUG */ z_fatal_error(reason, esf);