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:
Gregory Nutt 2016-06-21 05:26:08 -06:00
parent bf0499aca3
commit 7f16548f57
16 changed files with 24 additions and 19 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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);

View file

@ -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

View file

@ -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);

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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");

View file

@ -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

View file

@ -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

View file

@ -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, ...)