mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 23:40:19 +08:00
Replaces last three commits. Does the same thing, but does it in a way that does not change the usage model.
This commit is contained in:
@@ -395,9 +395,14 @@ endmenu # Customize Header Files
|
|||||||
|
|
||||||
menu "Debug Options"
|
menu "Debug Options"
|
||||||
|
|
||||||
|
config DEBUG_ALERT
|
||||||
|
bool
|
||||||
|
default n
|
||||||
|
|
||||||
config DEBUG_FEATURES
|
config DEBUG_FEATURES
|
||||||
bool "Enable Debug Features"
|
bool "Enable Debug Features"
|
||||||
default n
|
default n
|
||||||
|
select DEBUG_ALERT
|
||||||
---help---
|
---help---
|
||||||
Enables built-in debug features. Selecting this option will (1) Enable
|
Enables built-in debug features. Selecting this option will (1) Enable
|
||||||
debug assertions in the code, (2) enable extended parameter testing in
|
debug assertions in the code, (2) enable extended parameter testing in
|
||||||
|
|||||||
+1
-1
@@ -525,7 +525,7 @@ config ARCH_IRQPRIO
|
|||||||
config ARCH_STACKDUMP
|
config ARCH_STACKDUMP
|
||||||
bool "Dump stack on assertions"
|
bool "Dump stack on assertions"
|
||||||
default n
|
default n
|
||||||
depends on DEBUG_FEATURES
|
select DEBUG_ALERT
|
||||||
---help---
|
---help---
|
||||||
Enable to do stack dumps after assertions
|
Enable to do stack dumps after assertions
|
||||||
|
|
||||||
|
|||||||
@@ -311,7 +311,7 @@ static void _up_assert(int errorcode)
|
|||||||
|
|
||||||
void up_assert(const uint8_t *filename, int lineno)
|
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();
|
struct tcb_s *rtcb = this_task();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -366,7 +366,7 @@ static void _up_assert(int errorcode)
|
|||||||
|
|
||||||
void up_assert(const uint8_t *filename, int lineno)
|
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();
|
struct tcb_s *rtcb = this_task();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -372,7 +372,7 @@ static void _up_assert(int errorcode)
|
|||||||
|
|
||||||
void up_assert(const uint8_t *filename, int lineno)
|
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();
|
struct tcb_s *rtcb = this_task();
|
||||||
#endif
|
#endif
|
||||||
board_autoled_on(LED_ASSERTION);
|
board_autoled_on(LED_ASSERTION);
|
||||||
|
|||||||
@@ -375,7 +375,7 @@ static void _up_assert(int errorcode)
|
|||||||
|
|
||||||
void up_assert(const uint8_t *filename, int lineno)
|
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();
|
struct tcb_s *rtcb = this_task();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -367,7 +367,7 @@ static void _up_assert(int errorcode)
|
|||||||
|
|
||||||
void up_assert(const uint8_t *filename, int lineno)
|
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();
|
struct tcb_s *rtcb = this_task();
|
||||||
#endif
|
#endif
|
||||||
board_autoled_on(LED_ASSERTION);
|
board_autoled_on(LED_ASSERTION);
|
||||||
|
|||||||
@@ -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)
|
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();
|
struct tcb_s *rtcb = this_task();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -294,7 +294,7 @@ static void _up_assert(int errorcode)
|
|||||||
|
|
||||||
void up_assert(const uint8_t *filename, int lineno)
|
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();
|
struct tcb_s *rtcb = this_task();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -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)
|
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();
|
struct tcb_s *rtcb = this_task();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -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)
|
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();
|
struct tcb_s *rtcb = this_task();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -256,7 +256,7 @@ static void _up_assert(int errorcode)
|
|||||||
|
|
||||||
void up_assert(const uint8_t *filename, int lineno)
|
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();
|
struct tcb_s *rtcb = this_task();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ void up_assert(const uint8_t *filename, int lineno)
|
|||||||
void up_assert(void)
|
void up_assert(void)
|
||||||
#endif
|
#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();
|
struct tcb_s *rtcb = this_task();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -150,7 +150,7 @@ void up_assert(void)
|
|||||||
filename, lineno);
|
filename, lineno);
|
||||||
#endif
|
#endif
|
||||||
#else
|
#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);
|
_alert("Assertion failed: task: %s\n", rtcb->name);
|
||||||
#else
|
#else
|
||||||
_alert("Assertion failed\n");
|
_alert("Assertion failed\n");
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ void up_assert(const uint8_t *filename, int lineno)
|
|||||||
void up_assert(void)
|
void up_assert(void)
|
||||||
#endif
|
#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();
|
struct tcb_s *rtcb = this_task();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -113,7 +113,7 @@
|
|||||||
# define __arch_syslog syslog
|
# define __arch_syslog syslog
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_DEBUG_FEATURES
|
#ifdef CONFIG_DEBUG_ALERT
|
||||||
# define _alert(format, ...) \
|
# define _alert(format, ...) \
|
||||||
__arch_syslog(LOG_EMERG, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
|
__arch_syslog(LOG_EMERG, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
|
||||||
#else /* CONFIG_DEBUG_ERROR */
|
#else /* CONFIG_DEBUG_ERROR */
|
||||||
@@ -669,7 +669,7 @@
|
|||||||
|
|
||||||
/* Variadic macros NOT supported */
|
/* Variadic macros NOT supported */
|
||||||
|
|
||||||
#ifndef CONFIG_DEBUG_FEATURES
|
#ifndef CONFIG_DEBUG_ALERT
|
||||||
# define _alert (void)
|
# define _alert (void)
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
@@ -1483,7 +1483,7 @@ void lib_dumpbuffer(FAR const char *msg, FAR const uint8_t *buffer,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef CONFIG_CPP_HAVE_VARARGS
|
#ifndef CONFIG_CPP_HAVE_VARARGS
|
||||||
#ifndef CONFIG_DEBUG_FEATURES
|
#ifdef CONFIG_DEBUG_ALERT
|
||||||
int _alert(const char *format, ...);
|
int _alert(const char *format, ...);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_DEBUG_FEATURES
|
#ifdef CONFIG_DEBUG_ALERT
|
||||||
int _alert(const char *format, ...)
|
int _alert(const char *format, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
@@ -71,7 +71,7 @@ int _alert(const char *format, ...)
|
|||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_DEBUG_FEATURES */
|
#endif /* CONFIG_DEBUG_ALERT */
|
||||||
|
|
||||||
#ifdef CONFIG_DEBUG_ERROR
|
#ifdef CONFIG_DEBUG_ERROR
|
||||||
int _err(const char *format, ...)
|
int _err(const char *format, ...)
|
||||||
|
|||||||
Reference in New Issue
Block a user