From 58a3e7bdedfb0440c55aaa71740ad626c42990dd Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Mon, 7 Jul 2025 15:09:42 -0400 Subject: [PATCH] arch: add macros for dumping exceptions Add macros for dumping exceptions depending on availablity of logging or printk. Signed-off-by: Anas Nashif --- include/zephyr/arch/exception.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/zephyr/arch/exception.h b/include/zephyr/arch/exception.h index 68487be0cbd..b72e6d56766 100644 --- a/include/zephyr/arch/exception.h +++ b/include/zephyr/arch/exception.h @@ -8,6 +8,12 @@ #ifndef ZEPHYR_INCLUDE_ARCH_EXCEPTION_H_ #define ZEPHYR_INCLUDE_ARCH_EXCEPTION_H_ +#if defined(CONFIG_LOG) +#define EXCEPTION_DUMP(...) LOG_ERR(__VA_ARGS__) +#else +#define EXCEPTION_DUMP(format, ...) printk(format "\n", ##__VA_ARGS__) +#endif + #if defined(CONFIG_X86_64) #include #elif defined(CONFIG_X86)