diff --git a/Kconfig b/Kconfig index 7e9ae4eed3c..c174c16e4cb 100644 --- a/Kconfig +++ b/Kconfig @@ -395,9 +395,14 @@ endmenu # Customize Header Files menu "Debug Options" +config DEBUG_ALERT + bool + default n + config DEBUG_FEATURES bool "Enable Debug Features" default n + select DEBUG_ALERT ---help--- Enables built-in debug features. Selecting this option will (1) Enable debug assertions in the code, (2) enable extended parameter testing in diff --git a/arch/Kconfig b/arch/Kconfig index 92c7021677c..b3dd65f1bfa 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -525,7 +525,7 @@ config ARCH_IRQPRIO config ARCH_STACKDUMP bool "Dump stack on assertions" default n - depends on DEBUG_FEATURES + select DEBUG_ALERT ---help--- Enable to do stack dumps after assertions diff --git a/arch/arm/src/arm/up_assert.c b/arch/arm/src/arm/up_assert.c index c740f3e25b9..3d188174b3d 100644 --- a/arch/arm/src/arm/up_assert.c +++ b/arch/arm/src/arm/up_assert.c @@ -311,7 +311,7 @@ static void _up_assert(int errorcode) void up_assert(const uint8_t *filename, int lineno) { -#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_FEATURES) +#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT) struct tcb_s *rtcb = this_task(); #endif diff --git a/arch/arm/src/armv6-m/up_assert.c b/arch/arm/src/armv6-m/up_assert.c index 2c53f1f028d..f218cd477b0 100644 --- a/arch/arm/src/armv6-m/up_assert.c +++ b/arch/arm/src/armv6-m/up_assert.c @@ -366,7 +366,7 @@ static void _up_assert(int errorcode) void up_assert(const uint8_t *filename, int lineno) { -#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_FEATURES) +#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT) struct tcb_s *rtcb = this_task(); #endif diff --git a/arch/arm/src/armv7-a/arm_assert.c b/arch/arm/src/armv7-a/arm_assert.c index 84ff50e4957..3c798d33a0d 100644 --- a/arch/arm/src/armv7-a/arm_assert.c +++ b/arch/arm/src/armv7-a/arm_assert.c @@ -372,7 +372,7 @@ static void _up_assert(int errorcode) void up_assert(const uint8_t *filename, int lineno) { -#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_FEATURES) +#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT) struct tcb_s *rtcb = this_task(); #endif board_autoled_on(LED_ASSERTION); diff --git a/arch/arm/src/armv7-m/up_assert.c b/arch/arm/src/armv7-m/up_assert.c index 29dba2b2a65..b34cfc73950 100644 --- a/arch/arm/src/armv7-m/up_assert.c +++ b/arch/arm/src/armv7-m/up_assert.c @@ -375,7 +375,7 @@ static void _up_assert(int errorcode) void up_assert(const uint8_t *filename, int lineno) { -#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_FEATURES) +#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT) struct tcb_s *rtcb = this_task(); #endif diff --git a/arch/arm/src/armv7-r/arm_assert.c b/arch/arm/src/armv7-r/arm_assert.c index 49937b525e8..b841416450b 100644 --- a/arch/arm/src/armv7-r/arm_assert.c +++ b/arch/arm/src/armv7-r/arm_assert.c @@ -367,7 +367,7 @@ static void _up_assert(int errorcode) void up_assert(const uint8_t *filename, int lineno) { -#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_FEATURES) +#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT) struct tcb_s *rtcb = this_task(); #endif board_autoled_on(LED_ASSERTION); diff --git a/arch/avr/src/common/up_assert.c b/arch/avr/src/common/up_assert.c index 2d4197a4f46..92c3bde0175 100644 --- a/arch/avr/src/common/up_assert.c +++ b/arch/avr/src/common/up_assert.c @@ -131,7 +131,7 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg) void up_assert(const uint8_t *filename, int lineno) { -#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_FEATURES) +#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT) struct tcb_s *rtcb = this_task(); #endif diff --git a/arch/hc/src/m9s12/m9s12_assert.c b/arch/hc/src/m9s12/m9s12_assert.c index 3d2ab558714..496b3933a66 100644 --- a/arch/hc/src/m9s12/m9s12_assert.c +++ b/arch/hc/src/m9s12/m9s12_assert.c @@ -294,7 +294,7 @@ static void _up_assert(int errorcode) void up_assert(const uint8_t *filename, int lineno) { -#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_FEATURES) +#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT) struct tcb_s *rtcb = this_task(); #endif diff --git a/arch/mips/src/mips32/up_assert.c b/arch/mips/src/mips32/up_assert.c index f135ae748e0..5723fe18405 100644 --- a/arch/mips/src/mips32/up_assert.c +++ b/arch/mips/src/mips32/up_assert.c @@ -131,7 +131,7 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg) void up_assert(const uint8_t *filename, int lineno) { -#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_FEATURES) +#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT) struct tcb_s *rtcb = this_task(); #endif diff --git a/arch/sh/src/common/up_assert.c b/arch/sh/src/common/up_assert.c index d86c1b2531d..ec02578cfd0 100644 --- a/arch/sh/src/common/up_assert.c +++ b/arch/sh/src/common/up_assert.c @@ -132,7 +132,7 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg) void up_assert(const uint8_t *filename, int lineno) { -#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_FEATURES) +#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT) struct tcb_s *rtcb = this_task(); #endif diff --git a/arch/x86/src/common/up_assert.c b/arch/x86/src/common/up_assert.c index 09b2af9a4a4..7afec4e4bec 100644 --- a/arch/x86/src/common/up_assert.c +++ b/arch/x86/src/common/up_assert.c @@ -256,7 +256,7 @@ static void _up_assert(int errorcode) void up_assert(const uint8_t *filename, int lineno) { -#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_FEATURES) +#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT) struct tcb_s *rtcb = this_task(); #endif diff --git a/arch/z16/src/common/up_assert.c b/arch/z16/src/common/up_assert.c index 67ad5f53306..5346e9d48c9 100644 --- a/arch/z16/src/common/up_assert.c +++ b/arch/z16/src/common/up_assert.c @@ -135,7 +135,7 @@ void up_assert(const uint8_t *filename, int lineno) void up_assert(void) #endif { -#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_FEATURES) +#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT) struct tcb_s *rtcb = this_task(); #endif @@ -150,7 +150,7 @@ void up_assert(void) filename, lineno); #endif #else -#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_FEATURES) +#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT) _alert("Assertion failed: task: %s\n", rtcb->name); #else _alert("Assertion failed\n"); diff --git a/arch/z80/src/common/up_assert.c b/arch/z80/src/common/up_assert.c index 8d6488beac2..da899feb6f4 100644 --- a/arch/z80/src/common/up_assert.c +++ b/arch/z80/src/common/up_assert.c @@ -134,7 +134,7 @@ void up_assert(const uint8_t *filename, int lineno) void up_assert(void) #endif { -#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_FEATURES) +#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT) struct tcb_s *rtcb = this_task(); #endif diff --git a/include/debug.h b/include/debug.h index d9286224d1e..c2fc93dd53f 100644 --- a/include/debug.h +++ b/include/debug.h @@ -113,7 +113,7 @@ # define __arch_syslog syslog #endif -#ifdef CONFIG_DEBUG_FEATURES +#ifdef CONFIG_DEBUG_ALERT # define _alert(format, ...) \ __arch_syslog(LOG_EMERG, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__) #else /* CONFIG_DEBUG_ERROR */ @@ -669,7 +669,7 @@ /* Variadic macros NOT supported */ -#ifndef CONFIG_DEBUG_FEATURES +#ifndef CONFIG_DEBUG_ALERT # define _alert (void) # endif @@ -1483,7 +1483,7 @@ void lib_dumpbuffer(FAR const char *msg, FAR const uint8_t *buffer, */ #ifndef CONFIG_CPP_HAVE_VARARGS -#ifndef CONFIG_DEBUG_FEATURES +#ifdef CONFIG_DEBUG_ALERT int _alert(const char *format, ...); #endif diff --git a/libc/misc/lib_debug.c b/libc/misc/lib_debug.c index 0bc5d81bf67..098f3cc2dd7 100644 --- a/libc/misc/lib_debug.c +++ b/libc/misc/lib_debug.c @@ -59,7 +59,7 @@ * ****************************************************************************/ -#ifdef CONFIG_DEBUG_FEATURES +#ifdef CONFIG_DEBUG_ALERT int _alert(const char *format, ...) { va_list ap; @@ -71,7 +71,7 @@ int _alert(const char *format, ...) return ret; } -#endif /* CONFIG_DEBUG_FEATURES */ +#endif /* CONFIG_DEBUG_ALERT */ #ifdef CONFIG_DEBUG_ERROR int _err(const char *format, ...)