New debug macro: alert(). This is high priority, unconditional output and is used to simplify and stanardize crash error reporting.

This commit is contained in:
Gregory Nutt 2016-06-14 09:07:53 -06:00
parent 4f72ad74d2
commit a98bc05f65
47 changed files with 517 additions and 1252 deletions

View File

@ -1,7 +1,7 @@
/****************************************************************************
* arch/arm/src/arm/up_assert.c
*
* Copyright (C) 2007-2010, 2012-2015 Gregory Nutt. All rights reserved.
* Copyright (C) 2007-2010, 2012-2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -39,19 +39,6 @@
#include <nuttx/config.h>
/* Output debug info if stack dump is selected -- even if debug is not
* selected.
*/
#undef CONFIG_DEBUG_FEATURES
#undef CONFIG_DEBUG_ERROR
#undef CONFIG_DEBUG_WARN
#undef CONFIG_DEBUG_INFO
#define CONFIG_DEBUG_FEATURES 1
#define CONFIG_DEBUG_ERROR 1
#define CONFIG_DEBUG_WARN 1
#define CONFIG_DEBUG_INFO 1
#include <stdarg.h>
#include <stdint.h>
#include <stdlib.h>
@ -79,23 +66,6 @@
# undef CONFIG_ARCH_USBDUMP
#endif
/* The following is just intended to keep some ugliness out of the mainline
* code. We are going to print the task name if:
*
* CONFIG_TASK_NAME_SIZE > 0 && <-- The task has a name
* (defined(CONFIG_DEBUG_FEATURES) || <-- And the debug is enabled (llerr used)
* defined(CONFIG_ARCH_STACKDUMP) <-- Or lowsyslog() is used
*/
#undef CONFIG_PRINT_TASKNAME
#if CONFIG_TASK_NAME_SIZE > 0 && (defined(CONFIG_DEBUG_FEATURES) || defined(CONFIG_ARCH_STACKDUMP))
# define CONFIG_PRINT_TASKNAME 1
#endif
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
@ -129,7 +99,7 @@ static void up_stackdump(uint32_t sp, uint32_t stack_base)
for (stack = sp & ~0x1f; stack < stack_base; stack += 32)
{
uint32_t *ptr = (uint32_t *)stack;
llerr("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
alert("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
stack, ptr[0], ptr[1], ptr[2], ptr[3],
ptr[4], ptr[5], ptr[6], ptr[7]);
}
@ -156,12 +126,12 @@ static inline void up_registerdump(void)
for (regs = REG_R0; regs <= REG_R15; regs += 8)
{
uint32_t *ptr = (uint32_t *)&CURRENT_REGS[regs];
llerr("R%d: %08x %08x %08x %08x %08x %08x %08x %08x\n",
alert("R%d: %08x %08x %08x %08x %08x %08x %08x %08x\n",
regs, ptr[0], ptr[1], ptr[2], ptr[3],
ptr[4], ptr[5], ptr[6], ptr[7]);
}
llerr("CPSR: %08x\n", CURRENT_REGS[REG_CPSR]);
alert("CPSR: %08x\n", CURRENT_REGS[REG_CPSR]);
}
}
#else
@ -230,12 +200,12 @@ static void up_dumpstate(void)
/* Show interrupt stack info */
llerr("sp: %08x\n", sp);
llerr("IRQ stack:\n");
llerr(" base: %08x\n", istackbase);
llerr(" size: %08x\n", istacksize);
alert("sp: %08x\n", sp);
alert("IRQ stack:\n");
alert(" base: %08x\n", istackbase);
alert(" size: %08x\n", istacksize);
#ifdef CONFIG_STACK_COLORATION
llerr(" used: %08x\n", up_check_intstack());
alert(" used: %08x\n", up_check_intstack());
#endif
/* Does the current stack pointer lie within the interrupt
@ -253,24 +223,24 @@ static void up_dumpstate(void)
*/
sp = g_intstackbase;
llerr("sp: %08x\n", sp);
alert("sp: %08x\n", sp);
}
/* Show user stack info */
llerr("User stack:\n");
llerr(" base: %08x\n", ustackbase);
llerr(" size: %08x\n", ustacksize);
alert("User stack:\n");
alert(" base: %08x\n", ustackbase);
alert(" size: %08x\n", ustacksize);
#ifdef CONFIG_STACK_COLORATION
llerr(" used: %08x\n", up_check_tcbstack(rtcb));
alert(" used: %08x\n", up_check_tcbstack(rtcb));
#endif
#else
llerr("sp: %08x\n", sp);
llerr("stack base: %08x\n", ustackbase);
llerr("stack size: %08x\n", ustacksize);
alert("sp: %08x\n", sp);
alert("stack base: %08x\n", ustackbase);
alert("stack size: %08x\n", ustacksize);
#ifdef CONFIG_STACK_COLORATION
llerr("stack used: %08x\n", up_check_tcbstack(rtcb));
alert("stack used: %08x\n", up_check_tcbstack(rtcb));
#endif
#endif
@ -281,7 +251,7 @@ static void up_dumpstate(void)
if (sp > ustackbase || sp <= ustackbase - ustacksize)
{
#if !defined(CONFIG_ARCH_INTERRUPTSTACK) || CONFIG_ARCH_INTERRUPTSTACK < 4
llerr("ERROR: Stack pointer is not within allocated stack\n");
alert("ERROR: Stack pointer is not within allocated stack\n");
#endif
}
else
@ -341,17 +311,17 @@ static void _up_assert(int errorcode)
void up_assert(const uint8_t *filename, int lineno)
{
#ifdef CONFIG_PRINT_TASKNAME
#if CONFIG_TASK_NAME_SIZE > 0
struct tcb_s *rtcb = this_task();
#endif
board_autoled_on(LED_ASSERTION);
#ifdef CONFIG_PRINT_TASKNAME
llerr("Assertion failed at file:%s line: %d task: %s\n",
#if CONFIG_TASK_NAME_SIZE > 0
alert("Assertion failed at file:%s line: %d task: %s\n",
filename, lineno, rtcb->name);
#else
llerr("Assertion failed at file:%s line: %d\n",
alert("Assertion failed at file:%s line: %d\n",
filename, lineno);
#endif

View File

@ -1,7 +1,7 @@
/****************************************************************************
* arch/arm/src/arm/up_dataabort.c
*
* Copyright (C) 2007-2011, 2013 Gregory Nutt. All rights reserved.
* Copyright (C) 2007-2011, 2013, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -39,21 +39,6 @@
#include <nuttx/config.h>
/* Output debug info if stack dump is selected -- even if debug is not
* selected.
*/
#ifdef CONFIG_ARCH_STACKDUMP
# undef CONFIG_DEBUG_FEATURES
# undef CONFIG_DEBUG_ERROR
# undef CONFIG_DEBUG_WARN
# undef CONFIG_DEBUG_INFO
# define CONFIG_DEBUG_FEATURES 1
# define CONFIG_DEBUG_ERROR 1
# define CONFIG_DEBUG_WARN 1
# define CONFIG_DEBUG_INFO 1
#endif
#include <stdint.h>
#include <debug.h>
@ -67,18 +52,6 @@
# include "arm.h"
#endif
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
@ -116,7 +89,6 @@ void up_dataabort(uint32_t *regs, uint32_t far, uint32_t fsr)
* for register dumps and possibly context switching.
*/
savestate = (uint32_t *)CURRENT_REGS;
#endif
CURRENT_REGS = regs;
@ -184,7 +156,7 @@ void up_dataabort(uint32_t *regs, uint32_t far, uint32_t fsr)
segfault:
#endif
llerr("Data abort. PC: %08x FAR: %08x FSR: %08x\n", regs[REG_PC], far, fsr);
alert("Data abort. PC: %08x FAR: %08x FSR: %08x\n", regs[REG_PC], far, fsr);
PANIC();
}
@ -200,7 +172,7 @@ void up_dataabort(uint32_t *regs)
/* Crash -- possibly showing diagnost debug information. */
llerr("Data abort. PC: %08x\n", regs[REG_PC]);
alert("Data abort. PC: %08x\n", regs[REG_PC]);
PANIC();
}

View File

@ -1,7 +1,7 @@
/****************************************************************************
* arch/arm/src/arm/up_prefetchabort.c
*
* Copyright (C) 2007-2011, 2013 Gregory Nutt. All rights reserved.
* Copyright (C) 2007-2011, 2013, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -39,21 +39,6 @@
#include <nuttx/config.h>
/* Output debug info if stack dump is selected -- even if debug is not
* selected.
*/
#ifdef CONFIG_ARCH_STACKDUMP
# undef CONFIG_DEBUG_FEATURES
# undef CONFIG_DEBUG_ERROR
# undef CONFIG_DEBUG_WARN
# undef CONFIG_DEBUG_INFO
# define CONFIG_DEBUG_FEATURES 1
# define CONFIG_DEBUG_ERROR 1
# define CONFIG_DEBUG_WARN 1
# define CONFIG_DEBUG_INFO 1
#endif
#include <stdint.h>
#include <debug.h>
@ -152,7 +137,7 @@ void up_prefetchabort(uint32_t *regs)
else
#endif
{
llerr("Prefetch abort. PC: %08x\n", regs[REG_PC]);
alert("Prefetch abort. PC: %08x\n", regs[REG_PC]);
PANIC();
}
}

View File

@ -1,7 +1,7 @@
/****************************************************************************
* arch/arm/src/arm/up_syscall.c
*
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Copyright (C) 2007-2009, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -39,21 +39,6 @@
#include <nuttx/config.h>
/* Output debug info if stack dump is selected -- even if debug is not
* selected.
*/
#ifdef CONFIG_ARCH_STACKDUMP
# undef CONFIG_DEBUG_FEATURES
# undef CONFIG_DEBUG_ERROR
# undef CONFIG_DEBUG_WARN
# undef CONFIG_DEBUG_INFO
# define CONFIG_DEBUG_FEATURES 1
# define CONFIG_DEBUG_ERROR 1
# define CONFIG_DEBUG_WARN 1
# define CONFIG_DEBUG_INFO 1
#endif
#include <stdint.h>
#include <debug.h>
@ -62,22 +47,6 @@
#include "up_arch.h"
#include "up_internal.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* vectors
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
@ -86,8 +55,8 @@
* Name: up_syscall
*
* Description:
* SWI interrupts will vection here with insn=the SWI
* instruction and xcp=the interrupt context
* SWI interrupts will vector here with insn=the SWI instruction and
* xcp=the interrupt context
*
* The handler may get the SWI number be de-referencing
* the return address saved in the xcp and decoding
@ -97,7 +66,7 @@
void up_syscall(uint32_t *regs)
{
llerr("Syscall from 0x%x\n", regs[REG_PC]);
alert("Syscall from 0x%x\n", regs[REG_PC]);
CURRENT_REGS = regs;
PANIC();
}

View File

@ -1,7 +1,7 @@
/****************************************************************************
* arch/arm/src/arm/up_undefinedinsn.c
*
* Copyright (C) 2007-2009, 2013 Gregory Nutt. All rights reserved.
* Copyright (C) 2007-2009, 2013, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -39,21 +39,6 @@
#include <nuttx/config.h>
/* Output debug info if stack dump is selected -- even if debug is not
* selected.
*/
#ifdef CONFIG_ARCH_STACKDUMP
# undef CONFIG_DEBUG_FEATURES
# undef CONFIG_DEBUG_ERROR
# undef CONFIG_DEBUG_WARN
# undef CONFIG_DEBUG_INFO
# define CONFIG_DEBUG_FEATURES 1
# define CONFIG_DEBUG_ERROR 1
# define CONFIG_DEBUG_WARN 1
# define CONFIG_DEBUG_INFO 1
#endif
#include <stdint.h>
#include <assert.h>
#include <debug.h>
@ -62,18 +47,6 @@
#include "up_internal.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
@ -84,7 +57,7 @@
void up_undefinedinsn(uint32_t *regs)
{
llerr("Undefined instruction at 0x%x\n", regs[REG_PC]);
alert("Undefined instruction at 0x%x\n", regs[REG_PC]);
CURRENT_REGS = regs;
PANIC();
}

View File

@ -1,7 +1,7 @@
/****************************************************************************
* arch/arm/src/armv6-m/up_assert.c
*
* Copyright (C) 2013-2015 Gregory Nutt. All rights reserved.
* Copyright (C) 2013-2015, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -39,21 +39,6 @@
#include <nuttx/config.h>
/* Output debug info if stack dump is selected -- even if debug is not
* selected.
*/
#ifdef CONFIG_ARCH_STACKDUMP
# undef CONFIG_DEBUG_FEATURES
# undef CONFIG_DEBUG_ERROR
# undef CONFIG_DEBUG_WARN
# undef CONFIG_DEBUG_INFO
# define CONFIG_DEBUG_FEATURES 1
# define CONFIG_DEBUG_ERROR 1
# define CONFIG_DEBUG_WARN 1
# define CONFIG_DEBUG_INFO 1
#endif
#include <stdint.h>
#include <stdlib.h>
#include <assert.h>
@ -80,23 +65,6 @@
# undef CONFIG_ARCH_USBDUMP
#endif
/* The following is just intended to keep some ugliness out of the mainline
* code. We are going to print the task name if:
*
* CONFIG_TASK_NAME_SIZE > 0 && <-- The task has a name
* (defined(CONFIG_DEBUG_FEATURES) || <-- And the debug is enabled (llerr used)
* defined(CONFIG_ARCH_STACKDUMP) <-- Or lowsyslog() is used
*/
#undef CONFIG_PRINT_TASKNAME
#if CONFIG_TASK_NAME_SIZE > 0 && (defined(CONFIG_DEBUG_FEATURES) || defined(CONFIG_ARCH_STACKDUMP))
# define CONFIG_PRINT_TASKNAME 1
#endif
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
@ -130,7 +98,7 @@ static void up_stackdump(uint32_t sp, uint32_t stack_base)
for (stack = sp & ~0x1f; stack < stack_base; stack += 32)
{
uint32_t *ptr = (uint32_t *)stack;
llerr("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
alert("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
stack, ptr[0], ptr[1], ptr[2], ptr[3],
ptr[4], ptr[5], ptr[6], ptr[7]);
}
@ -148,12 +116,12 @@ static void up_taskdump(FAR struct tcb_s *tcb, FAR void *arg)
{
/* Dump interesting properties of this task */
#ifdef CONFIG_PRINT_TASKNAME
llerr("%s: PID=%d Stack Used=%lu of %lu\n",
#if CONFIG_TASK_NAME_SIZE > 0
alert("%s: PID=%d Stack Used=%lu of %lu\n",
tcb->name, tcb->pid, (unsigned long)up_check_tcbstack(tcb),
(unsigned long)tcb->adj_stack_size);
#else
llerr("PID: %d Stack Used=%lu of %lu\n",
alert("PID: %d Stack Used=%lu of %lu\n",
tcb->pid, (unsigned long)up_check_tcbstack(tcb),
(unsigned long)tcb->adj_stack_size);
#endif
@ -188,22 +156,22 @@ static inline void up_registerdump(void)
{
/* Yes.. dump the interrupt registers */
llerr("R0: %08x %08x %08x %08x %08x %08x %08x %08x\n",
alert("R0: %08x %08x %08x %08x %08x %08x %08x %08x\n",
CURRENT_REGS[REG_R0], CURRENT_REGS[REG_R1],
CURRENT_REGS[REG_R2], CURRENT_REGS[REG_R3],
CURRENT_REGS[REG_R4], CURRENT_REGS[REG_R5],
CURRENT_REGS[REG_R6], CURRENT_REGS[REG_R7]);
llerr("R8: %08x %08x %08x %08x %08x %08x %08x %08x\n",
alert("R8: %08x %08x %08x %08x %08x %08x %08x %08x\n",
CURRENT_REGS[REG_R8], CURRENT_REGS[REG_R9],
CURRENT_REGS[REG_R10], CURRENT_REGS[REG_R11],
CURRENT_REGS[REG_R12], CURRENT_REGS[REG_R13],
CURRENT_REGS[REG_R14], CURRENT_REGS[REG_R15]);
#ifdef CONFIG_BUILD_PROTECTED
llerr("xPSR: %08x PRIMASK: %08x EXEC_RETURN: %08x\n",
alert("xPSR: %08x PRIMASK: %08x EXEC_RETURN: %08x\n",
CURRENT_REGS[REG_XPSR], CURRENT_REGS[REG_PRIMASK],
CURRENT_REGS[REG_EXC_RETURN]);
#else
llerr("xPSR: %08x PRIMASK: %08x\n",
alert("xPSR: %08x PRIMASK: %08x\n",
CURRENT_REGS[REG_XPSR], CURRENT_REGS[REG_PRIMASK]);
#endif
}
@ -274,12 +242,12 @@ static void up_dumpstate(void)
/* Show interrupt stack info */
llerr("sp: %08x\n", sp);
llerr("IRQ stack:\n");
llerr(" base: %08x\n", istackbase);
llerr(" size: %08x\n", istacksize);
alert("sp: %08x\n", sp);
alert("IRQ stack:\n");
alert(" base: %08x\n", istackbase);
alert(" size: %08x\n", istacksize);
#ifdef CONFIG_STACK_COLORATION
llerr(" used: %08x\n", up_check_intstack());
alert(" used: %08x\n", up_check_intstack());
#endif
/* Does the current stack pointer lie within the interrupt
@ -301,14 +269,14 @@ static void up_dumpstate(void)
if (CURRENT_REGS)
{
sp = CURRENT_REGS[REG_R13];
llerr("sp: %08x\n", sp);
alert("sp: %08x\n", sp);
}
llerr("User stack:\n");
llerr(" base: %08x\n", ustackbase);
llerr(" size: %08x\n", ustacksize);
alert("User stack:\n");
alert(" base: %08x\n", ustackbase);
alert(" size: %08x\n", ustacksize);
#ifdef CONFIG_STACK_COLORATION
llerr(" used: %08x\n", up_check_tcbstack(rtcb));
alert(" used: %08x\n", up_check_tcbstack(rtcb));
#endif
/* Dump the user stack if the stack pointer lies within the allocated user
@ -321,11 +289,11 @@ static void up_dumpstate(void)
}
#else
llerr("sp: %08x\n", sp);
llerr("stack base: %08x\n", ustackbase);
llerr("stack size: %08x\n", ustacksize);
alert("sp: %08x\n", sp);
alert("stack base: %08x\n", ustackbase);
alert("stack size: %08x\n", ustacksize);
#ifdef CONFIG_STACK_COLORATION
llerr("stack used: %08x\n", up_check_tcbstack(rtcb));
alert("stack used: %08x\n", up_check_tcbstack(rtcb));
#endif
/* Dump the user stack if the stack pointer lies within the allocated user
@ -334,7 +302,7 @@ static void up_dumpstate(void)
if (sp > ustackbase || sp <= ustackbase - ustacksize)
{
llerr("ERROR: Stack pointer is not within allocated stack\n");
alert("ERROR: Stack pointer is not within allocated stack\n");
}
else
{
@ -398,17 +366,17 @@ static void _up_assert(int errorcode)
void up_assert(const uint8_t *filename, int lineno)
{
#ifdef CONFIG_PRINT_TASKNAME
#if CONFIG_TASK_NAME_SIZE > 0
struct tcb_s *rtcb = this_task();
#endif
board_autoled_on(LED_ASSERTION);
#ifdef CONFIG_PRINT_TASKNAME
llerr("Assertion failed at file:%s line: %d task: %s\n",
#if CONFIG_TASK_NAME_SIZE > 0
alert("Assertion failed at file:%s line: %d task: %s\n",
filename, lineno, rtcb->name);
#else
llerr("Assertion failed at file:%s line: %d\n",
alert("Assertion failed at file:%s line: %d\n",
filename, lineno);
#endif

View File

@ -1,7 +1,7 @@
/****************************************************************************
* arch/arm/src/armv6-m/up_dumpnvic.c
*
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
* Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -39,15 +39,6 @@
#include <nuttx/config.h>
/* Output debug info even if debug output is not selected. */
#undef CONFIG_DEBUG_ERROR
#undef CONFIG_DEBUG_WARN
#undef CONFIG_DEBUG_INFO
#define CONFIG_DEBUG_ERROR 1
#define CONFIG_DEBUG_WARN 1
#define CONFIG_DEBUG_INFO 1
#include <sys/types.h>
#include <debug.h>
@ -73,6 +64,7 @@
void up_dumpnvic(FAR const char *msg)
{
#ifdef CONFIG_DEBUG_INFO
irqstate_t flags;
int i;
@ -103,6 +95,7 @@ void up_dumpnvic(FAR const char *msg)
getreg32(ARMV6M_SYSCON_SHPR3));
leave_critical_section(flags);
#endif
}
#endif /* CONFIG_DEBUG_FEATURES */

View File

@ -1,7 +1,7 @@
/****************************************************************************
* arch/arm/src/armv7-a/arm_assert.c
*
* Copyright (C) 2013-2015 Gregory Nutt. All rights reserved.
* Copyright (C) 2013-2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -39,21 +39,6 @@
#include <nuttx/config.h>
/* Output debug info if stack dump is selected -- even if debug is not
* selected.
*/
#ifdef CONFIG_ARCH_STACKDUMP
# undef CONFIG_DEBUG_FEATURES
# undef CONFIG_DEBUG_ERROR
# undef CONFIG_DEBUG_WARN
# undef CONFIG_DEBUG_INFO
# define CONFIG_DEBUG_FEATURES 1
# define CONFIG_DEBUG_ERROR 1
# define CONFIG_DEBUG_WARN 1
# define CONFIG_DEBUG_INFO 1
#endif
#include <stdint.h>
#include <stdlib.h>
#include <assert.h>
@ -79,19 +64,6 @@
# undef CONFIG_ARCH_USBDUMP
#endif
/* The following is just intended to keep some ugliness out of the mainline
* code. We are going to print the task name if:
*
* CONFIG_TASK_NAME_SIZE > 0 && <-- The task has a name
* (defined(CONFIG_DEBUG_FEATURES) || <-- And the debug is enabled (llerr used)
* defined(CONFIG_ARCH_STACKDUMP) <-- Or lowsyslog() is used
*/
#undef CONFIG_PRINT_TASKNAME
#if CONFIG_TASK_NAME_SIZE > 0 && (defined(CONFIG_DEBUG_FEATURES) || defined(CONFIG_ARCH_STACKDUMP))
# define CONFIG_PRINT_TASKNAME 1
#endif
/****************************************************************************
* Private Functions
****************************************************************************/
@ -125,7 +97,7 @@ static void up_stackdump(uint32_t sp, uint32_t stack_base)
for (stack = sp & ~0x1f; stack < stack_base; stack += 32)
{
uint32_t *ptr = (uint32_t *)stack;
llerr("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
alert("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
stack, ptr[0], ptr[1], ptr[2], ptr[3],
ptr[4], ptr[5], ptr[6], ptr[7]);
}
@ -143,12 +115,12 @@ static void up_taskdump(FAR struct tcb_s *tcb, FAR void *arg)
{
/* Dump interesting properties of this task */
#ifdef CONFIG_PRINT_TASKNAME
llerr("%s: PID=%d Stack Used=%lu of %lu\n",
#if CONFIG_TASK_NAME_SIZE > 0
alert("%s: PID=%d Stack Used=%lu of %lu\n",
tcb->name, tcb->pid, (unsigned long)up_check_tcbstack(tcb),
(unsigned long)tcb->adj_stack_size);
#else
llerr("PID: %d Stack Used=%lu of %lu\n",
alert("PID: %d Stack Used=%lu of %lu\n",
tcb->pid, (unsigned long)up_check_tcbstack(tcb),
(unsigned long)tcb->adj_stack_size);
#endif
@ -188,12 +160,12 @@ static inline void up_registerdump(void)
for (regs = REG_R0; regs <= REG_R15; regs += 8)
{
uint32_t *ptr = (uint32_t *)&CURRENT_REGS[regs];
llerr("R%d: %08x %08x %08x %08x %08x %08x %08x %08x\n",
alert("R%d: %08x %08x %08x %08x %08x %08x %08x %08x\n",
regs, ptr[0], ptr[1], ptr[2], ptr[3],
ptr[4], ptr[5], ptr[6], ptr[7]);
}
llerr("CPSR: %08x\n", CURRENT_REGS[REG_CPSR]);
alert("CPSR: %08x\n", CURRENT_REGS[REG_CPSR]);
}
}
#else
@ -257,7 +229,7 @@ static void up_dumpstate(void)
ustacksize = (uint32_t)rtcb->adj_stack_size;
}
llerr("Current sp: %08x\n", sp);
alert("Current sp: %08x\n", sp);
#if CONFIG_ARCH_INTERRUPTSTACK > 3
/* Get the limits on the interrupt stack memory */
@ -267,21 +239,21 @@ static void up_dumpstate(void)
/* Show interrupt stack info */
llerr("Interrupt stack:\n");
llerr(" base: %08x\n", istackbase);
llerr(" size: %08x\n", istacksize);
alert("Interrupt stack:\n");
alert(" base: %08x\n", istackbase);
alert(" size: %08x\n", istacksize);
#ifdef CONFIG_STACK_COLORATION
llerr(" used: %08x\n", up_check_intstack());
alert(" used: %08x\n", up_check_intstack());
#endif
#endif
/* Show user stack info */
llerr("User stack:\n");
llerr(" base: %08x\n", ustackbase);
llerr(" size: %08x\n", ustacksize);
alert("User stack:\n");
alert(" base: %08x\n", ustackbase);
alert(" size: %08x\n", ustacksize);
#ifdef CONFIG_STACK_COLORATION
llerr(" used: %08x\n", up_check_tcbstack(rtcb));
alert(" used: %08x\n", up_check_tcbstack(rtcb));
#endif
#ifdef CONFIG_ARCH_KERNEL_STACK
@ -291,9 +263,9 @@ static void up_dumpstate(void)
{
kstackbase = (uint32_t)rtcb->xcp.kstack + CONFIG_ARCH_KERNEL_STACKSIZE - 4;
llerr("Kernel stack:\n");
llerr(" base: %08x\n", kstackbase);
llerr(" size: %08x\n", CONFIG_ARCH_KERNEL_STACKSIZE);
alert("Kernel stack:\n");
alert(" base: %08x\n", kstackbase);
alert(" size: %08x\n", CONFIG_ARCH_KERNEL_STACKSIZE);
}
#endif
@ -304,7 +276,7 @@ static void up_dumpstate(void)
{
/* Yes.. dump the interrupt stack */
llerr("Interrupt Stack\n", sp);
alert("Interrupt Stack\n", sp);
up_stackdump(sp, istackbase);
/* Extract the user stack pointer which should lie
@ -312,7 +284,7 @@ static void up_dumpstate(void)
*/
sp = g_intstackbase;
llerr("User sp: %08x\n", sp);
alert("User sp: %08x\n", sp);
}
#endif
@ -322,7 +294,7 @@ static void up_dumpstate(void)
if (sp > ustackbase - ustacksize && sp < ustackbase)
{
llerr("User Stack\n", sp);
alert("User Stack\n", sp);
up_stackdump(sp, ustackbase);
}
@ -333,7 +305,7 @@ static void up_dumpstate(void)
if (sp >= (uint32_t)rtcb->xcp.kstack && sp < kstackbase)
{
llerr("Kernel Stack\n", sp);
alert("Kernel Stack\n", sp);
up_stackdump(sp, kstackbase);
}
#endif
@ -341,7 +313,7 @@ static void up_dumpstate(void)
#ifdef CONFIG_SMP
/* Show the CPU number */
llerr("CPU%d:\n", up_cpu_index());
alert("CPU%d:\n", up_cpu_index());
#endif
/* Then dump the CPU registers (if available) */
@ -400,16 +372,16 @@ static void _up_assert(int errorcode)
void up_assert(const uint8_t *filename, int lineno)
{
#ifdef CONFIG_PRINT_TASKNAME
#if CONFIG_TASK_NAME_SIZE > 0
struct tcb_s *rtcb = this_task();
#endif
board_autoled_on(LED_ASSERTION);
#ifdef CONFIG_PRINT_TASKNAME
llerr("Assertion failed at file:%s line: %d task: %s\n",
#if CONFIG_TASK_NAME_SIZE > 0
alert("Assertion failed at file:%s line: %d task: %s\n",
filename, lineno, rtcb->name);
#else
llerr("Assertion failed at file:%s line: %d\n",
alert("Assertion failed at file:%s line: %d\n",
filename, lineno);
#endif
up_dumpstate();

View File

@ -1,7 +1,7 @@
/****************************************************************************
* arch/arm/src/armv7-a/arm_dataabort.c
*
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
* Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -39,21 +39,6 @@
#include <nuttx/config.h>
/* Output debug info if stack dump is selected -- even if debug is not
* selected.
*/
#ifdef CONFIG_ARCH_STACKDUMP
# undef CONFIG_DEBUG_FEATURES
# undef CONFIG_DEBUG_ERROR
# undef CONFIG_DEBUG_WARN
# undef CONFIG_DEBUG_INFO
# define CONFIG_DEBUG_FEATURES 1
# define CONFIG_DEBUG_ERROR 1
# define CONFIG_DEBUG_WARN 1
# define CONFIG_DEBUG_INFO 1
#endif
#include <stdint.h>
#include <debug.h>
@ -167,7 +152,7 @@ uint32_t *arm_dataabort(uint32_t *regs, uint32_t dfar, uint32_t dfsr)
return regs;
segfault:
llerr("Data abort. PC: %08x DFAR: %08x DFSR: %08x\n",
alert("Data abort. PC: %08x DFAR: %08x DFSR: %08x\n",
regs[REG_PC], dfar, dfsr);
PANIC();
return regs; /* To keep the compiler happy */
@ -185,7 +170,7 @@ uint32_t *arm_dataabort(uint32_t *regs, uint32_t dfar, uint32_t dfsr)
/* Crash -- possibly showing diagnostic debug information. */
llerr("Data abort. PC: %08x DFAR: %08x DFSR: %08x\n",
alert("Data abort. PC: %08x DFAR: %08x DFSR: %08x\n",
regs[REG_PC], dfar, dfsr);
PANIC();
return regs; /* To keep the compiler happy */

View File

@ -1,7 +1,7 @@
/****************************************************************************
* arch/arm/src/armv7-a/arm_prefetchabort.c
*
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
* Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -39,21 +39,6 @@
#include <nuttx/config.h>
/* Output debug info if stack dump is selected -- even if debug is not
* selected.
*/
#ifdef CONFIG_ARCH_STACKDUMP
# undef CONFIG_DEBUG_FEATURES
# undef CONFIG_DEBUG_ERROR
# undef CONFIG_DEBUG_WARN
# undef CONFIG_DEBUG_INFO
# define CONFIG_DEBUG_FEATURES 1
# define CONFIG_DEBUG_ERROR 1
# define CONFIG_DEBUG_WARN 1
# define CONFIG_DEBUG_INFO 1
#endif
#include <stdint.h>
#include <debug.h>
@ -138,7 +123,7 @@ uint32_t *arm_prefetchabort(uint32_t *regs, uint32_t ifar, uint32_t ifsr)
}
else
{
llerr("Prefetch abort. PC: %08x IFAR: %08x IFSR: %08x\n",
alert("Prefetch abort. PC: %08x IFAR: %08x IFSR: %08x\n",
regs[REG_PC], ifar, ifsr);
PANIC();
}
@ -158,7 +143,7 @@ uint32_t *arm_prefetchabort(uint32_t *regs, uint32_t ifar, uint32_t ifsr)
/* Crash -- possibly showing diagnostic debug information. */
llerr("Prefetch abort. PC: %08x IFAR: %08x IFSR: %08x\n",
alert("Prefetch abort. PC: %08x IFAR: %08x IFSR: %08x\n",
regs[REG_PC], ifar, ifsr);
PANIC();
return regs; /* To keep the compiler happy */

View File

@ -1,7 +1,7 @@
/****************************************************************************
* arch/arm/src/armv7-a/arm_syscall.c
*
* Copyright (C) 2013-2014 Gregory Nutt. All rights reserved.
* Copyright (C) 2013-2014, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -39,21 +39,6 @@
#include <nuttx/config.h>
/* Output debug info if stack dump is selected -- even if debug is not
* selected.
*/
#ifdef CONFIG_ARCH_STACKDUMP
# undef CONFIG_DEBUG_FEATURES
# undef CONFIG_DEBUG_ERROR
# undef CONFIG_DEBUG_WARN
# undef CONFIG_DEBUG_INFO
# define CONFIG_DEBUG_FEATURES 1
# define CONFIG_DEBUG_ERROR 1
# define CONFIG_DEBUG_WARN 1
# define CONFIG_DEBUG_INFO 1
#endif
#include <stdint.h>
#include <string.h>
#include <syscall.h>
@ -75,9 +60,13 @@
/* Debug ********************************************************************/
#if defined(CONFIG_DEBUG_SYSCALL)
# define svcerr(format, ...) llerr(format, ##__VA_ARGS__)
# define svcerr(format, ...) llerr(format, ##__VA_ARGS__)
# define svcwarn(format, ...) llwarn(format, ##__VA_ARGS__)
# define svcinfo(format, ...) llinfo(format, ##__VA_ARGS__)
#else
# define svcerr(x...)
# define svcwarn(x...)
# define svcinfo(x...)
#endif
/****************************************************************************
@ -183,14 +172,14 @@ uint32_t *arm_syscall(uint32_t *regs)
*/
#if defined(CONFIG_DEBUG_SYSCALL)
svcerr("SYSCALL Entry: regs: %p cmd: %d\n", regs, cmd);
svcerr(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n",
svcinfo("SYSCALL Entry: regs: %p cmd: %d\n", regs, cmd);
svcinfo(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n",
regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3],
regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]);
svcerr(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n",
svcinfo(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n",
regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11],
regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]);
svcerr("CPSR: %08x\n", regs[REG_CPSR]);
svcinfo("CPSR: %08x\n", regs[REG_CPSR]);
#endif
/* Handle the SVCall according to the command in R0 */
@ -508,14 +497,14 @@ uint32_t *arm_syscall(uint32_t *regs)
#if defined(CONFIG_DEBUG_SYSCALL)
/* Report what happened */
svcerr("SYSCALL Exit: regs: %p\n", regs);
svcerr(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n",
regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3],
regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]);
svcerr(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n",
regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11],
svcinfo("SYSCALL Exit: regs: %p\n", regs);
svcinfo(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n",
regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3],
regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]);
svcinfo(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n",
regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11],
regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]);
svcerr("CPSR: %08x\n", regs[REG_CPSR]);
svcinfo("CPSR: %08x\n", regs[REG_CPSR]);
#endif
/* Return the last value of curent_regs. This supports context switches
@ -530,7 +519,7 @@ uint32_t *arm_syscall(uint32_t *regs)
uint32_t *arm_syscall(uint32_t *regs)
{
llerr("SYSCALL from 0x%x\n", regs[REG_PC]);
alert("SYSCALL from 0x%x\n", regs[REG_PC]);
CURRENT_REGS = regs;
PANIC();
}

View File

@ -1,7 +1,7 @@
/****************************************************************************
* arch/arm/src/armv7-a/arm_undefinedinsn.c
*
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
* Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -39,21 +39,6 @@
#include <nuttx/config.h>
/* Output debug info if stack dump is selected -- even if debug is not
* selected.
*/
#ifdef CONFIG_ARCH_STACKDUMP
# undef CONFIG_DEBUG_FEATURES
# undef CONFIG_DEBUG_ERROR
# undef CONFIG_DEBUG_WARN
# undef CONFIG_DEBUG_INFO
# define CONFIG_DEBUG_FEATURES 1
# define CONFIG_DEBUG_ERROR 1
# define CONFIG_DEBUG_WARN 1
# define CONFIG_DEBUG_INFO 1
#endif
#include <stdint.h>
#include <assert.h>
#include <debug.h>
@ -72,7 +57,7 @@
uint32_t *arm_undefinedinsn(uint32_t *regs)
{
llerr("Undefined instruction at 0x%x\n", regs[REG_PC]);
alert("Undefined instruction at 0x%x\n", regs[REG_PC]);
CURRENT_REGS = regs;
PANIC();
return regs; /* To keep the compiler happy */

View File

@ -1,7 +1,7 @@
/****************************************************************************
* arch/arm/src/armv7-m/up_assert.c
*
* Copyright (C) 2009-2010, 2012-2015 Gregory Nutt. All rights reserved.
* Copyright (C) 2009-2010, 2012-2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -39,21 +39,6 @@
#include <nuttx/config.h>
/* Output debug info if stack dump is selected -- even if debug is not
* selected.
*/
#ifdef CONFIG_ARCH_STACKDUMP
# undef CONFIG_DEBUG_FEATURES
# undef CONFIG_DEBUG_ERROR
# undef CONFIG_DEBUG_WARN
# undef CONFIG_DEBUG_INFO
# define CONFIG_DEBUG_FEATURES 1
# define CONFIG_DEBUG_ERROR 1
# define CONFIG_DEBUG_WARN 1
# define CONFIG_DEBUG_INFO 1
#endif
#include <stdint.h>
#include <stdlib.h>
#include <assert.h>
@ -79,23 +64,6 @@
# undef CONFIG_ARCH_USBDUMP
#endif
/* The following is just intended to keep some ugliness out of the mainline
* code. We are going to print the task name if:
*
* CONFIG_TASK_NAME_SIZE > 0 && <-- The task has a name
* (defined(CONFIG_DEBUG_FEATURES) || <-- And the debug is enabled (llerr used)
* defined(CONFIG_ARCH_STACKDUMP) <-- Or lowsyslog() is used
*/
#undef CONFIG_PRINT_TASKNAME
#if CONFIG_TASK_NAME_SIZE > 0 && (defined(CONFIG_DEBUG_FEATURES) || defined(CONFIG_ARCH_STACKDUMP))
# define CONFIG_PRINT_TASKNAME 1
#endif
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
@ -129,7 +97,7 @@ static void up_stackdump(uint32_t sp, uint32_t stack_base)
for (stack = sp & ~0x1f; stack < stack_base; stack += 32)
{
uint32_t *ptr = (uint32_t *)stack;
llerr("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
alert("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
stack, ptr[0], ptr[1], ptr[2], ptr[3],
ptr[4], ptr[5], ptr[6], ptr[7]);
}
@ -147,12 +115,12 @@ static void up_taskdump(FAR struct tcb_s *tcb, FAR void *arg)
{
/* Dump interesting properties of this task */
#ifdef CONFIG_PRINT_TASKNAME
llerr("%s: PID=%d Stack Used=%lu of %lu\n",
#if CONFIG_TASK_NAME_SIZE > 0
alert("%s: PID=%d Stack Used=%lu of %lu\n",
tcb->name, tcb->pid, (unsigned long)up_check_tcbstack(tcb),
(unsigned long)tcb->adj_stack_size);
#else
llerr("PID: %d Stack Used=%lu of %lu\n",
alert("PID: %d Stack Used=%lu of %lu\n",
tcb->pid, (unsigned long)up_check_tcbstack(tcb),
(unsigned long)tcb->adj_stack_size);
#endif
@ -187,29 +155,29 @@ static inline void up_registerdump(void)
{
/* Yes.. dump the interrupt registers */
llerr("R0: %08x %08x %08x %08x %08x %08x %08x %08x\n",
alert("R0: %08x %08x %08x %08x %08x %08x %08x %08x\n",
CURRENT_REGS[REG_R0], CURRENT_REGS[REG_R1],
CURRENT_REGS[REG_R2], CURRENT_REGS[REG_R3],
CURRENT_REGS[REG_R4], CURRENT_REGS[REG_R5],
CURRENT_REGS[REG_R6], CURRENT_REGS[REG_R7]);
llerr("R8: %08x %08x %08x %08x %08x %08x %08x %08x\n",
alert("R8: %08x %08x %08x %08x %08x %08x %08x %08x\n",
CURRENT_REGS[REG_R8], CURRENT_REGS[REG_R9],
CURRENT_REGS[REG_R10], CURRENT_REGS[REG_R11],
CURRENT_REGS[REG_R12], CURRENT_REGS[REG_R13],
CURRENT_REGS[REG_R14], CURRENT_REGS[REG_R15]);
#ifdef CONFIG_ARMV7M_USEBASEPRI
llerr("xPSR: %08x BASEPRI: %08x CONTROL: %08x\n",
alert("xPSR: %08x BASEPRI: %08x CONTROL: %08x\n",
CURRENT_REGS[REG_XPSR], CURRENT_REGS[REG_BASEPRI],
getcontrol());
#else
llerr("xPSR: %08x PRIMASK: %08x CONTROL: %08x\n",
alert("xPSR: %08x PRIMASK: %08x CONTROL: %08x\n",
CURRENT_REGS[REG_XPSR], CURRENT_REGS[REG_PRIMASK],
getcontrol());
#endif
#ifdef REG_EXC_RETURN
llerr("EXC_RETURN: %08x\n", CURRENT_REGS[REG_EXC_RETURN]);
alert("EXC_RETURN: %08x\n", CURRENT_REGS[REG_EXC_RETURN]);
#endif
}
}
@ -279,12 +247,12 @@ static void up_dumpstate(void)
/* Show interrupt stack info */
llerr("sp: %08x\n", sp);
llerr("IRQ stack:\n");
llerr(" base: %08x\n", istackbase);
llerr(" size: %08x\n", istacksize);
alert("sp: %08x\n", sp);
alert("IRQ stack:\n");
alert(" base: %08x\n", istackbase);
alert(" size: %08x\n", istacksize);
#ifdef CONFIG_STACK_COLORATION
llerr(" used: %08x\n", up_check_intstack());
alert(" used: %08x\n", up_check_intstack());
#endif
/* Does the current stack pointer lie within the interrupt
@ -306,14 +274,14 @@ static void up_dumpstate(void)
if (CURRENT_REGS)
{
sp = CURRENT_REGS[REG_R13];
llerr("sp: %08x\n", sp);
alert("sp: %08x\n", sp);
}
llerr("User stack:\n");
llerr(" base: %08x\n", ustackbase);
llerr(" size: %08x\n", ustacksize);
alert("User stack:\n");
alert(" base: %08x\n", ustackbase);
alert(" size: %08x\n", ustacksize);
#ifdef CONFIG_STACK_COLORATION
llerr(" used: %08x\n", up_check_tcbstack(rtcb));
alert(" used: %08x\n", up_check_tcbstack(rtcb));
#endif
/* Dump the user stack if the stack pointer lies within the allocated user
@ -329,11 +297,11 @@ static void up_dumpstate(void)
/* Show user stack info */
llerr("sp: %08x\n", sp);
llerr("stack base: %08x\n", ustackbase);
llerr("stack size: %08x\n", ustacksize);
alert("sp: %08x\n", sp);
alert("stack base: %08x\n", ustackbase);
alert("stack size: %08x\n", ustacksize);
#ifdef CONFIG_STACK_COLORATION
llerr("stack used: %08x\n", up_check_tcbstack(rtcb));
alert("stack used: %08x\n", up_check_tcbstack(rtcb));
#endif
/* Dump the user stack if the stack pointer lies within the allocated user
@ -342,7 +310,7 @@ static void up_dumpstate(void)
if (sp > ustackbase || sp <= ustackbase - ustacksize)
{
llerr("ERROR: Stack pointer is not within the allocated stack\n");
alert("ERROR: Stack pointer is not within the allocated stack\n");
}
else
{
@ -407,17 +375,17 @@ static void _up_assert(int errorcode)
void up_assert(const uint8_t *filename, int lineno)
{
#ifdef CONFIG_PRINT_TASKNAME
#if CONFIG_TASK_NAME_SIZE > 0
struct tcb_s *rtcb = this_task();
#endif
board_autoled_on(LED_ASSERTION);
#ifdef CONFIG_PRINT_TASKNAME
llerr("Assertion failed at file:%s line: %d task: %s\n",
#if CONFIG_TASK_NAME_SIZE > 0
alert("Assertion failed at file:%s line: %d task: %s\n",
filename, lineno, rtcb->name);
#else
llerr("Assertion failed at file:%s line: %d\n",
alert("Assertion failed at file:%s line: %d\n",
filename, lineno);
#endif

View File

@ -1,7 +1,7 @@
/****************************************************************************
* arch/arm/src/armv7-r/arm_assert.c
*
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
* Copyright (C) 2015-2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -39,21 +39,6 @@
#include <nuttx/config.h>
/* Output debug info if stack dump is selected -- even if debug is not
* selected.
*/
#ifdef CONFIG_ARCH_STACKDUMP
# undef CONFIG_DEBUG_FEATURES
# undef CONFIG_DEBUG_ERROR
# undef CONFIG_DEBUG_WARN
# undef CONFIG_DEBUG_INFO
# define CONFIG_DEBUG_FEATURES 1
# define CONFIG_DEBUG_ERROR 1
# define CONFIG_DEBUG_WARN 1
# define CONFIG_DEBUG_INFO 1
#endif
#include <stdint.h>
#include <stdlib.h>
#include <assert.h>
@ -80,19 +65,6 @@
# undef CONFIG_ARCH_USBDUMP
#endif
/* The following is just intended to keep some ugliness out of the mainline
* code. We are going to print the task name if:
*
* CONFIG_TASK_NAME_SIZE > 0 && <-- The task has a name
* (defined(CONFIG_DEBUG_FEATURES) || <-- And the debug is enabled (llerr used)
* defined(CONFIG_ARCH_STACKDUMP) <-- Or lowsyslog() is used
*/
#undef CONFIG_PRINT_TASKNAME
#if CONFIG_TASK_NAME_SIZE > 0 && (defined(CONFIG_DEBUG_FEATURES) || defined(CONFIG_ARCH_STACKDUMP))
# define CONFIG_PRINT_TASKNAME 1
#endif
/****************************************************************************
* Private Functions
****************************************************************************/
@ -144,7 +116,7 @@ static void up_taskdump(FAR struct tcb_s *tcb, FAR void *arg)
{
/* Dump interesting properties of this task */
#ifdef CONFIG_PRINT_TASKNAME
#if CONFIG_TASK_NAME_SIZE > 0
llerr("%s: PID=%d Stack Used=%lu of %lu\n",
tcb->name, tcb->pid, (unsigned long)up_check_tcbstack(tcb),
(unsigned long)tcb->adj_stack_size);
@ -395,12 +367,12 @@ static void _up_assert(int errorcode)
void up_assert(const uint8_t *filename, int lineno)
{
#ifdef CONFIG_PRINT_TASKNAME
#if CONFIG_TASK_NAME_SIZE > 0
struct tcb_s *rtcb = this_task();
#endif
board_autoled_on(LED_ASSERTION);
#ifdef CONFIG_PRINT_TASKNAME
#if CONFIG_TASK_NAME_SIZE > 0
llerr("Assertion failed at file:%s line: %d task: %s\n",
filename, lineno, rtcb->name);
#else

View File

@ -1,7 +1,7 @@
/****************************************************************************
* arch/arm/src/armv7-r/arm_dataabort.c
*
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
* Copyright (C) 2015-2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -39,21 +39,6 @@
#include <nuttx/config.h>
/* Output debug info if stack dump is selected -- even if debug is not
* selected.
*/
#ifdef CONFIG_ARCH_STACKDUMP
# undef CONFIG_DEBUG_FEATURES
# undef CONFIG_DEBUG_ERROR
# undef CONFIG_DEBUG_WARN
# undef CONFIG_DEBUG_INFO
# define CONFIG_DEBUG_FEATURES 1
# define CONFIG_DEBUG_ERROR 1
# define CONFIG_DEBUG_WARN 1
# define CONFIG_DEBUG_INFO 1
#endif
#include <stdint.h>
#include <debug.h>
@ -90,7 +75,7 @@ uint32_t *arm_dataabort(uint32_t *regs, uint32_t dfar, uint32_t dfsr)
/* Crash -- possibly showing diagnostic debug information. */
llerr("Data abort. PC: %08x DFAR: %08x DFSR: %08x\n",
alert("Data abort. PC: %08x DFAR: %08x DFSR: %08x\n",
regs[REG_PC], dfar, dfsr);
PANIC();
return regs; /* To keep the compiler happy */

View File

@ -1,7 +1,7 @@
/****************************************************************************
* arch/arm/src/armv7-r/arm_prefetchabort.c
*
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
* Copyright (C) 2015-2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -39,21 +39,6 @@
#include <nuttx/config.h>
/* Output debug info if stack dump is selected -- even if debug is not
* selected.
*/
#ifdef CONFIG_ARCH_STACKDUMP
# undef CONFIG_DEBUG_FEATURES
# undef CONFIG_DEBUG_ERROR
# undef CONFIG_DEBUG_WARN
# undef CONFIG_DEBUG_INFO
# define CONFIG_DEBUG_FEATURES 1
# define CONFIG_DEBUG_ERROR 1
# define CONFIG_DEBUG_WARN 1
# define CONFIG_DEBUG_INFO 1
#endif
#include <stdint.h>
#include <debug.h>
@ -86,7 +71,7 @@ uint32_t *arm_prefetchabort(uint32_t *regs, uint32_t ifar, uint32_t ifsr)
/* Crash -- possibly showing diagnostic debug information. */
llerr("Prefetch abort. PC: %08x IFAR: %08x IFSR: %08x\n",
alert("Prefetch abort. PC: %08x IFAR: %08x IFSR: %08x\n",
regs[REG_PC], ifar, ifsr);
PANIC();
return regs; /* To keep the compiler happy */

View File

@ -39,21 +39,6 @@
#include <nuttx/config.h>
/* Output debug info if stack dump is selected -- even if debug is not
* selected.
*/
#ifdef CONFIG_ARCH_STACKDUMP
# undef CONFIG_DEBUG_FEATURES
# undef CONFIG_DEBUG_ERROR
# undef CONFIG_DEBUG_WARN
# undef CONFIG_DEBUG_INFO
# define CONFIG_DEBUG_FEATURES 1
# define CONFIG_DEBUG_ERROR 1
# define CONFIG_DEBUG_WARN 1
# define CONFIG_DEBUG_INFO 1
#endif
#include <stdint.h>
#include <string.h>
#include <syscall.h>
@ -74,9 +59,13 @@
/* Debug ********************************************************************/
#if defined(CONFIG_DEBUG_SYSCALL)
# define svcerr(format, ...) llerr(format, ##__VA_ARGS__)
# define svcerr(format, ...) llerr(format, ##__VA_ARGS__)
# define svcwarn(format, ...) llwarn(format, ##__VA_ARGS__)
# define svcinfo(format, ...) llinfo(format, ##__VA_ARGS__)
#else
# define svcerr(x...)
# define svcwarn(x...)
# define svcinfo(x...)
#endif
/****************************************************************************
@ -182,14 +171,14 @@ uint32_t *arm_syscall(uint32_t *regs)
*/
#if defined(CONFIG_DEBUG_SYSCALL)
svcerr("SYSCALL Entry: regs: %p cmd: %d\n", regs, cmd);
svcerr(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n",
regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3],
regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]);
svcerr(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n",
regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11],
regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]);
svcerr("CPSR: %08x\n", regs[REG_CPSR]);
svcinfo("SYSCALL Entry: regs: %p cmd: %d\n", regs, cmd);
svcinfo(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n",
regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3],
regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]);
svcinfo(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n",
regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11],
regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]);
svcinfo("CPSR: %08x\n", regs[REG_CPSR]);
#endif
/* Handle the SVCall according to the command in R0 */
@ -507,14 +496,14 @@ uint32_t *arm_syscall(uint32_t *regs)
#if defined(CONFIG_DEBUG_SYSCALL)
/* Report what happened */
svcerr("SYSCALL Exit: regs: %p\n", regs);
svcerr(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n",
regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3],
regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]);
svcerr(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n",
regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11],
regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]);
svcerr("CPSR: %08x\n", regs[REG_CPSR]);
svcinfo("SYSCALL Exit: regs: %p\n", regs);
svcinfo(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n",
regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3],
regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]);
svcinfo(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n",
regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11],
regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]);
svcinfo("CPSR: %08x\n", regs[REG_CPSR]);
#endif
/* Return the last value of curent_regs. This supports context switches
@ -529,7 +518,7 @@ uint32_t *arm_syscall(uint32_t *regs)
uint32_t *arm_syscall(uint32_t *regs)
{
llerr("SYSCALL from 0x%x\n", regs[REG_PC]);
alert("SYSCALL from 0x%x\n", regs[REG_PC]);
CURRENT_REGS = regs;
PANIC();
}

View File

@ -1,7 +1,7 @@
/****************************************************************************
* arch/arm/src/armv7-r/arm_undefinedinsn.c
*
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
* Copyright (C) 2015-2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -39,21 +39,6 @@
#include <nuttx/config.h>
/* Output debug info if stack dump is selected -- even if debug is not
* selected.
*/
#ifdef CONFIG_ARCH_STACKDUMP
# undef CONFIG_DEBUG_FEATURES
# undef CONFIG_DEBUG_ERROR
# undef CONFIG_DEBUG_WARN
# undef CONFIG_DEBUG_INFO
# define CONFIG_DEBUG_FEATURES 1
# define CONFIG_DEBUG_ERROR 1
# define CONFIG_DEBUG_WARN 1
# define CONFIG_DEBUG_INFO 1
#endif
#include <stdint.h>
#include <assert.h>
#include <debug.h>
@ -72,7 +57,7 @@
uint32_t *arm_undefinedinsn(uint32_t *regs)
{
llerr("Undefined instruction at 0x%x\n", regs[REG_PC]);
alert("Undefined instruction at 0x%x\n", regs[REG_PC]);
CURRENT_REGS = regs;
PANIC();
return regs; /* To keep the compiler happy */

View File

@ -41,11 +41,7 @@
/* Output debug info even if debug output is not selected. */
#undef CONFIG_DEBUG_ERROR
#undef CONFIG_DEBUG_WARN
#undef CONFIG_DEBUG_INFO
#define CONFIG_DEBUG_ERROR 1
#define CONFIG_DEBUG_WARN 1
#define CONFIG_DEBUG_INFO 1
#include <sys/types.h>
@ -122,12 +118,12 @@ void kl_dumpgpio(gpio_cfgset_t pinset, const char *msg)
flags = enter_critical_section();
llerr("GPIO%c pinset: %08x base: %08x -- %s\n",
g_portchar[port], pinset, base, msg);
llerr(" PDOR: %08x PDIR: %08x PDDR: %08x\n",
getreg32(base + KL_GPIO_PDOR_OFFSET),
getreg32(base + KL_GPIO_PDIR_OFFSET),
getreg32(base + KL_GPIO_PDDR_OFFSET));
llinfo("GPIO%c pinset: %08x base: %08x -- %s\n",
g_portchar[port], pinset, base, msg);
llinfo(" PDOR: %08x PDIR: %08x PDDR: %08x\n",
getreg32(base + KL_GPIO_PDOR_OFFSET),
getreg32(base + KL_GPIO_PDIR_OFFSET),
getreg32(base + KL_GPIO_PDDR_OFFSET));
leave_critical_section(flags);
}

View File

@ -1,7 +1,7 @@
/****************************************************************************
* arch/arm/src/lpc11xx/lpc11_gpiodbg.c
*
* Copyright (C) 2010-2011, 2013 Gregory Nutt. All rights reserved.
* Copyright (C) 2010-2011, 2013, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -41,11 +41,7 @@
/* Output debug info even if debug output is not selected. */
#undef CONFIG_DEBUG_ERROR
#undef CONFIG_DEBUG_WARN
#undef CONFIG_DEBUG_INFO
#define CONFIG_DEBUG_ERROR 1
#define CONFIG_DEBUG_WARN 1
#define CONFIG_DEBUG_INFO 1
#include <sys/types.h>
@ -158,32 +154,33 @@ int lpc11_dumpgpio(lpc11_pinset_t pinset, const char *msg)
/* The following requires exclusive access to the GPIO registers */
flags = enter_critical_section();
llerr("GPIO%c pin%d (pinset: %08x) -- %s\n",
llinfo("GPIO%c pin%d (pinset: %08x) -- %s\n",
port + '0', pin, pinset, msg);
#if defined(LPC176x)
llerr(" PINSEL[%08x]: %08x PINMODE[%08x]: %08x ODMODE[%08x]: %08x\n",
pinsel, pinsel ? getreg32(pinsel) : 0,
pinmode, pinmode ? getreg32(pinmode) : 0,
g_odmode[port], getreg32(g_odmode[port]));
llinfo(" PINSEL[%08x]: %08x PINMODE[%08x]: %08x ODMODE[%08x]: %08x\n",
pinsel, pinsel ? getreg32(pinsel) : 0,
pinmode, pinmode ? getreg32(pinmode) : 0,
g_odmode[port], getreg32(g_odmode[port]));
#elif defined(LPC178x)
llerr(" IOCON[%08x]: %08x\n", iocon, getreg32(iocon));
llinfo(" IOCON[%08x]: %08x\n", iocon, getreg32(iocon));
#endif
base = g_fiobase[port];
llerr(" FIODIR[%08x]: %08x FIOMASK[%08x]: %08x FIOPIN[%08x]: %08x\n",
base+LPC11_FIO_DIR_OFFSET, getreg32(base+LPC11_FIO_DIR_OFFSET),
base+LPC11_FIO_MASK_OFFSET, getreg32(base+LPC11_FIO_MASK_OFFSET),
base+LPC11_FIO_PIN_OFFSET, getreg32(base+LPC11_FIO_PIN_OFFSET));
llinfo(" FIODIR[%08x]: %08x FIOMASK[%08x]: %08x FIOPIN[%08x]: %08x\n",
base+LPC11_FIO_DIR_OFFSET, getreg32(base+LPC11_FIO_DIR_OFFSET),
base+LPC11_FIO_MASK_OFFSET, getreg32(base+LPC11_FIO_MASK_OFFSET),
base+LPC11_FIO_PIN_OFFSET, getreg32(base+LPC11_FIO_PIN_OFFSET));
base = g_intbase[port];
llerr(" IOINTSTATUS[%08x]: %08x INTSTATR[%08x]: %08x INSTATF[%08x]: %08x\n",
LPC11_GPIOINT_IOINTSTATUS, getreg32(LPC11_GPIOINT_IOINTSTATUS),
base+LPC11_GPIOINT_INTSTATR_OFFSET, getreg32(base+LPC11_GPIOINT_INTSTATR_OFFSET),
base+LPC11_GPIOINT_INTSTATF_OFFSET, getreg32(base+LPC11_GPIOINT_INTSTATF_OFFSET));
llerr(" INTENR[%08x]: %08x INTENF[%08x]: %08x\n",
base+LPC11_GPIOINT_INTENR_OFFSET, getreg32(base+LPC11_GPIOINT_INTENR_OFFSET),
base+LPC11_GPIOINT_INTENF_OFFSET, getreg32(base+LPC11_GPIOINT_INTENF_OFFSET));
llinfo(" IOINTSTATUS[%08x]: %08x INTSTATR[%08x]: %08x INSTATF[%08x]: %08x\n",
LPC11_GPIOINT_IOINTSTATUS, getreg32(LPC11_GPIOINT_IOINTSTATUS),
base+LPC11_GPIOINT_INTSTATR_OFFSET, getreg32(base+LPC11_GPIOINT_INTSTATR_OFFSET),
base+LPC11_GPIOINT_INTSTATF_OFFSET, getreg32(base+LPC11_GPIOINT_INTSTATF_OFFSET));
llinfo(" INTENR[%08x]: %08x INTENF[%08x]: %08x\n",
base+LPC11_GPIOINT_INTENR_OFFSET, getreg32(base+LPC11_GPIOINT_INTENR_OFFSET),
base+LPC11_GPIOINT_INTENF_OFFSET, getreg32(base+LPC11_GPIOINT_INTENF_OFFSET));
leave_critical_section(flags);
return OK;
}

View File

@ -1,7 +1,7 @@
/****************************************************************************
* arch/arm/src/lpc17xx/lpc17_gpiodbg.c
*
* Copyright (C) 2010-2011, 2013 Gregory Nutt. All rights reserved.
* Copyright (C) 2010-2011, 2013, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -41,11 +41,7 @@
/* Output debug info even if debug output is not selected. */
#undef CONFIG_DEBUG_ERROR
#undef CONFIG_DEBUG_WARN
#undef CONFIG_DEBUG_INFO
#define CONFIG_DEBUG_ERROR 1
#define CONFIG_DEBUG_WARN 1
#define CONFIG_DEBUG_INFO 1
#include <sys/types.h>
@ -158,32 +154,33 @@ int lpc17_dumpgpio(lpc17_pinset_t pinset, const char *msg)
/* The following requires exclusive access to the GPIO registers */
flags = enter_critical_section();
llerr("GPIO%c pin%d (pinset: %08x) -- %s\n",
port + '0', pin, pinset, msg);
llinfo("GPIO%c pin%d (pinset: %08x) -- %s\n",
port + '0', pin, pinset, msg);
#if defined(LPC176x)
llerr(" PINSEL[%08x]: %08x PINMODE[%08x]: %08x ODMODE[%08x]: %08x\n",
pinsel, pinsel ? getreg32(pinsel) : 0,
pinmode, pinmode ? getreg32(pinmode) : 0,
g_odmode[port], getreg32(g_odmode[port]));
llinfo(" PINSEL[%08x]: %08x PINMODE[%08x]: %08x ODMODE[%08x]: %08x\n",
pinsel, pinsel ? getreg32(pinsel) : 0,
pinmode, pinmode ? getreg32(pinmode) : 0,
g_odmode[port], getreg32(g_odmode[port]));
#elif defined(LPC178x)
llerr(" IOCON[%08x]: %08x\n", iocon, getreg32(iocon));
llinfo(" IOCON[%08x]: %08x\n", iocon, getreg32(iocon));
#endif
base = g_fiobase[port];
llerr(" FIODIR[%08x]: %08x FIOMASK[%08x]: %08x FIOPIN[%08x]: %08x\n",
base+LPC17_FIO_DIR_OFFSET, getreg32(base+LPC17_FIO_DIR_OFFSET),
base+LPC17_FIO_MASK_OFFSET, getreg32(base+LPC17_FIO_MASK_OFFSET),
base+LPC17_FIO_PIN_OFFSET, getreg32(base+LPC17_FIO_PIN_OFFSET));
llinfo(" FIODIR[%08x]: %08x FIOMASK[%08x]: %08x FIOPIN[%08x]: %08x\n",
base+LPC17_FIO_DIR_OFFSET, getreg32(base+LPC17_FIO_DIR_OFFSET),
base+LPC17_FIO_MASK_OFFSET, getreg32(base+LPC17_FIO_MASK_OFFSET),
base+LPC17_FIO_PIN_OFFSET, getreg32(base+LPC17_FIO_PIN_OFFSET));
base = g_intbase[port];
llerr(" IOINTSTATUS[%08x]: %08x INTSTATR[%08x]: %08x INSTATF[%08x]: %08x\n",
LPC17_GPIOINT_IOINTSTATUS, getreg32(LPC17_GPIOINT_IOINTSTATUS),
base+LPC17_GPIOINT_INTSTATR_OFFSET, getreg32(base+LPC17_GPIOINT_INTSTATR_OFFSET),
base+LPC17_GPIOINT_INTSTATF_OFFSET, getreg32(base+LPC17_GPIOINT_INTSTATF_OFFSET));
llerr(" INTENR[%08x]: %08x INTENF[%08x]: %08x\n",
base+LPC17_GPIOINT_INTENR_OFFSET, getreg32(base+LPC17_GPIOINT_INTENR_OFFSET),
base+LPC17_GPIOINT_INTENF_OFFSET, getreg32(base+LPC17_GPIOINT_INTENF_OFFSET));
llinfo(" IOINTSTATUS[%08x]: %08x INTSTATR[%08x]: %08x INSTATF[%08x]: %08x\n",
LPC17_GPIOINT_IOINTSTATUS, getreg32(LPC17_GPIOINT_IOINTSTATUS),
base+LPC17_GPIOINT_INTSTATR_OFFSET, getreg32(base+LPC17_GPIOINT_INTSTATR_OFFSET),
base+LPC17_GPIOINT_INTSTATF_OFFSET, getreg32(base+LPC17_GPIOINT_INTSTATF_OFFSET));
llinfo(" INTENR[%08x]: %08x INTENF[%08x]: %08x\n",
base+LPC17_GPIOINT_INTENR_OFFSET, getreg32(base+LPC17_GPIOINT_INTENR_OFFSET),
base+LPC17_GPIOINT_INTENF_OFFSET, getreg32(base+LPC17_GPIOINT_INTENF_OFFSET));
leave_critical_section(flags);
return OK;
}

View File

@ -43,11 +43,7 @@
#ifdef CONFIG_DEBUG_GPIO
/* Output informational debug info even if debug output is not enabled. */
# undef CONFIG_DEBUG_ERROR
# undef CONFIG_DEBUG_WARN
# undef CONFIG_DEBUG_INFO
# define CONFIG_DEBUG_ERROR 1
# define CONFIG_DEBUG_WARN 1
# define CONFIG_DEBUG_INFO 1
#endif

View File

@ -41,11 +41,7 @@
/* Output debug info even if debug output is not selected. */
#undef CONFIG_DEBUG_ERROR
#undef CONFIG_DEBUG_WARN
#undef CONFIG_DEBUG_INFO
#define CONFIG_DEBUG_ERROR 1
#define CONFIG_DEBUG_WARN 1
#define CONFIG_DEBUG_INFO 1
#include <sys/types.h>

View File

@ -41,11 +41,7 @@
/* Output debug info even if debug output is not selected. */
#undef CONFIG_DEBUG_ERROR
#undef CONFIG_DEBUG_WARN
#undef CONFIG_DEBUG_INFO
#define CONFIG_DEBUG_ERROR 1
#define CONFIG_DEBUG_WARN 1
#define CONFIG_DEBUG_INFO 1
#include <stdint.h>

View File

@ -1,7 +1,7 @@
/****************************************************************************
* arch/avr/src/avr/up_dumpstate.c
*
* Copyright (C) 2011, 2014 Gregory Nutt. All rights reserved.
* Copyright (C) 2011, 2014, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -39,17 +39,6 @@
#include <nuttx/config.h>
/* Output debug info -- even if debug is not selected. */
#undef CONFIG_DEBUG_FEATURES
#undef CONFIG_DEBUG_ERROR
#undef CONFIG_DEBUG_WARN
#undef CONFIG_DEBUG_INFO
#define CONFIG_DEBUG_FEATURES 1
#define CONFIG_DEBUG_ERROR 1
#define CONFIG_DEBUG_WARN 1
#define CONFIG_DEBUG_INFO 1
#include <stdint.h>
#include <stdlib.h>
#include <assert.h>
@ -101,7 +90,7 @@ static void up_stackdump(uint16_t sp, uint16_t stack_base)
for (stack = sp & ~3; stack < stack_base; stack += 12)
{
uint8_t *ptr = (uint8_t *)stack;
llerr("%04x: %02x %02x %02x %02x %02x %02x %02x %02x"
alert("%04x: %02x %02x %02x %02x %02x %02x %02x %02x"
" %02x %02x %02x %02x\n",
stack,
ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], ptr[5], ptr[6], ptr[7],
@ -119,28 +108,28 @@ static inline void up_registerdump(void)
if (g_current_regs)
{
llerr("R%02d: %02x %02x %02x %02x %02x %02x %02x %02x\n",
alert("R%02d: %02x %02x %02x %02x %02x %02x %02x %02x\n",
0,
g_current_regs[REG_R0], g_current_regs[REG_R1],
g_current_regs[REG_R2], g_current_regs[REG_R3],
g_current_regs[REG_R4], g_current_regs[REG_R5],
g_current_regs[REG_R6], g_current_regs[REG_R7]);
llerr("R%02d: %02x %02x %02x %02x %02x %02x %02x %02x\n",
alert("R%02d: %02x %02x %02x %02x %02x %02x %02x %02x\n",
8,
g_current_regs[REG_R8], g_current_regs[REG_R9],
g_current_regs[REG_R10], g_current_regs[REG_R11],
g_current_regs[REG_R12], g_current_regs[REG_R13],
g_current_regs[REG_R14], g_current_regs[REG_R15]);
llerr("R%02d: %02x %02x %02x %02x %02x %02x %02x %02x\n",
alert("R%02d: %02x %02x %02x %02x %02x %02x %02x %02x\n",
16,
g_current_regs[REG_R16], g_current_regs[REG_R17],
g_current_regs[REG_R18], g_current_regs[REG_R19],
g_current_regs[REG_R20], g_current_regs[REG_R21],
g_current_regs[REG_R22], g_current_regs[REG_R23]);
llerr("R%02d: %02x %02x %02x %02x %02x %02x %02x %02x\n",
alert("R%02d: %02x %02x %02x %02x %02x %02x %02x %02x\n",
24,
g_current_regs[REG_R24], g_current_regs[REG_R25],
g_current_regs[REG_R26], g_current_regs[REG_R27],
@ -148,12 +137,12 @@ static inline void up_registerdump(void)
g_current_regs[REG_R30], g_current_regs[REG_R31]);
#if !defined(REG_PC2)
llerr("PC: %02x%02x SP: %02x%02x SREG: %02x\n",
alert("PC: %02x%02x SP: %02x%02x SREG: %02x\n",
g_current_regs[REG_PC0], g_current_regs[REG_PC1],
g_current_regs[REG_SPH], g_current_regs[REG_SPL],
g_current_regs[REG_SREG]);
#else
llerr("PC: %02x%02x%02x SP: %02x%02x SREG: %02x\n",
alert("PC: %02x%02x%02x SP: %02x%02x SREG: %02x\n",
g_current_regs[REG_PC0], g_current_regs[REG_PC1],
g_current_regs[REG_PC2], g_current_regs[REG_SPH],
g_current_regs[REG_SPL], g_current_regs[REG_SREG]);
@ -201,12 +190,12 @@ void up_dumpstate(void)
/* Show interrupt stack info */
llerr("sp: %04x\n", sp);
llerr("IRQ stack:\n");
llerr(" base: %04x\n", istackbase);
llerr(" size: %04x\n", istacksize);
alert("sp: %04x\n", sp);
alert("IRQ stack:\n");
alert(" base: %04x\n", istackbase);
alert(" size: %04x\n", istacksize);
#ifdef CONFIG_STACK_COLORATION
llerr(" used: %08x\n", up_check_intstack());
alert(" used: %08x\n", up_check_intstack());
#endif
/* Does the current stack pointer lie within the interrupt
@ -228,14 +217,14 @@ void up_dumpstate(void)
if (g_current_regs)
{
sp = g_current_regs[REG_R13];
llerr("sp: %04x\n", sp);
alert("sp: %04x\n", sp);
}
llerr("User stack:\n");
llerr(" base: %04x\n", ustackbase);
llerr(" size: %04x\n", ustacksize);
alert("User stack:\n");
alert(" base: %04x\n", ustackbase);
alert(" size: %04x\n", ustacksize);
#ifdef CONFIG_STACK_COLORATION
llerr(" used: %08x\n", up_check_tcbstack(rtcb));
alert(" used: %08x\n", up_check_tcbstack(rtcb));
#endif
/* Dump the user stack if the stack pointer lies within the allocated user
@ -247,11 +236,11 @@ void up_dumpstate(void)
up_stackdump(sp, ustackbase);
}
#else
llerr("sp: %04x\n", sp);
llerr("stack base: %04x\n", ustackbase);
llerr("stack size: %04x\n", ustacksize);
alert("sp: %04x\n", sp);
alert("stack base: %04x\n", ustackbase);
alert("stack size: %04x\n", ustacksize);
#ifdef CONFIG_STACK_COLORATION
llerr("stack used: %08x\n", up_check_tcbstack(rtcb));
alert("stack used: %08x\n", up_check_tcbstack(rtcb));
#endif
/* Dump the user stack if the stack pointer lies within the allocated user
@ -260,7 +249,7 @@ void up_dumpstate(void)
if (sp > ustackbase || sp <= ustackbase - ustacksize)
{
llerr("ERROR: Stack pointer is not within allocated stack\n");
alert("ERROR: Stack pointer is not within allocated stack\n");
}
else
{

View File

@ -1,7 +1,7 @@
/****************************************************************************
* arch/avr/src/avr32/up_dumpstate.c
*
* Copyright (C) 2010-2011, 2014 Gregory Nutt. All rights reserved.
* Copyright (C) 2010-2011, 2014, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -39,17 +39,6 @@
#include <nuttx/config.h>
/* Output debug info -- even if debug is not selected. */
#undef CONFIG_DEBUG_FEATURES
#undef CONFIG_DEBUG_ERROR
#undef CONFIG_DEBUG_WARN
#undef CONFIG_DEBUG_INFO
#define CONFIG_DEBUG_FEATURES 1
#define CONFIG_DEBUG_ERROR 1
#define CONFIG_DEBUG_WARN 1
#define CONFIG_DEBUG_INFO 1
#include <stdint.h>
#include <stdlib.h>
#include <assert.h>
@ -97,7 +86,7 @@ static void up_stackdump(uint32_t sp, uint32_t stack_base)
for (stack = sp & ~0x1f; stack < stack_base; stack += 32)
{
uint32_t *ptr = (uint32_t *)stack;
llerr("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
alert("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
stack, ptr[0], ptr[1], ptr[2], ptr[3],
ptr[4], ptr[5], ptr[6], ptr[7]);
}
@ -113,21 +102,21 @@ static inline void up_registerdump(void)
if (g_current_regs)
{
llerr("R%d: %08x %08x %08x %08x %08x %08x %08x %08x\n",
alert("R%d: %08x %08x %08x %08x %08x %08x %08x %08x\n",
0,
g_current_regs[REG_R0], g_current_regs[REG_R1],
g_current_regs[REG_R2], g_current_regs[REG_R3],
g_current_regs[REG_R4], g_current_regs[REG_R5],
g_current_regs[REG_R6], g_current_regs[REG_R7]);
llerr("R%d: %08x %08x %08x %08x %08x %08x %08x %08x\n",
alert("R%d: %08x %08x %08x %08x %08x %08x %08x %08x\n",
8,
g_current_regs[REG_R8], g_current_regs[REG_R9],
g_current_regs[REG_R10], g_current_regs[REG_R11],
g_current_regs[REG_R12], g_current_regs[REG_R13],
g_current_regs[REG_R14], g_current_regs[REG_R15]);
llerr("SR: %08x\n", g_current_regs[REG_SR]);
alert("SR: %08x\n", g_current_regs[REG_SR]);
}
}
@ -167,12 +156,12 @@ void up_dumpstate(void)
/* Show interrupt stack info */
llerr("sp: %08x\n", sp);
llerr("IRQ stack:\n");
llerr(" base: %08x\n", istackbase);
llerr(" size: %08x\n", istacksize);
alert("sp: %08x\n", sp);
alert("IRQ stack:\n");
alert(" base: %08x\n", istackbase);
alert(" size: %08x\n", istacksize);
#ifdef CONFIG_STACK_COLORATION
llerr(" used: %08x\n", up_check_intstack());
alert(" used: %08x\n", up_check_intstack());
#endif
/* Does the current stack pointer lie within the interrupt
@ -194,14 +183,14 @@ void up_dumpstate(void)
if (g_current_regs)
{
sp = g_current_regs[REG_R13];
llerr("sp: %08x\n", sp);
alert("sp: %08x\n", sp);
}
llerr("User stack:\n");
llerr(" base: %08x\n", ustackbase);
llerr(" size: %08x\n", ustacksize);
alert("User stack:\n");
alert(" base: %08x\n", ustackbase);
alert(" size: %08x\n", ustacksize);
#ifdef CONFIG_STACK_COLORATION
llerr(" used: %08x\n", up_check_tcbstack(rtcb));
alert(" used: %08x\n", up_check_tcbstack(rtcb));
#endif
/* Dump the user stack if the stack pointer lies within the allocated user
@ -213,11 +202,11 @@ void up_dumpstate(void)
up_stackdump(sp, ustackbase);
}
#else
llerr("sp: %08x\n", sp);
llerr("stack base: %08x\n", ustackbase);
llerr("stack size: %08x\n", ustacksize);
alert("sp: %08x\n", sp);
alert("stack base: %08x\n", ustackbase);
alert("stack size: %08x\n", ustacksize);
#ifdef CONFIG_STACK_COLORATION
llerr("stack used: %08x\n", up_check_tcbstack(rtcb));
alert("stack used: %08x\n", up_check_tcbstack(rtcb));
#endif
/* Dump the user stack if the stack pointer lies within the allocated user
@ -226,7 +215,7 @@ void up_dumpstate(void)
if (sp > ustackbase || sp <= ustackbase - ustacksize)
{
llerr("ERROR: Stack pointer is not within allocated stack\n");
alert("ERROR: Stack pointer is not within allocated stack\n");
}
else
{

View File

@ -1,7 +1,7 @@
/****************************************************************************
* arch/avr/src/common/up_assert.c
*
* Copyright (C) 2010-2011, 2013-2015 Gregory Nutt. All rights reserved.
* Copyright (C) 2010-2011, 2013-2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -39,21 +39,6 @@
#include <nuttx/config.h>
/* Output debug info if stack dump is selected -- even if debug is not
* selected.
*/
#ifdef CONFIG_ARCH_STACKDUMP
# undef CONFIG_DEBUG_FEATURES
# undef CONFIG_DEBUG_ERROR
# undef CONFIG_DEBUG_WARN
# undef CONFIG_DEBUG_INFO
# define CONFIG_DEBUG_FEATURES 1
# define CONFIG_DEBUG_ERROR 1
# define CONFIG_DEBUG_WARN 1
# define CONFIG_DEBUG_INFO 1
#endif
#include <stdint.h>
#include <stdlib.h>
#include <assert.h>
@ -79,23 +64,6 @@
# undef CONFIG_ARCH_USBDUMP
#endif
/* The following is just intended to keep some ugliness out of the mainline
* code. We are going to print the task name if:
*
* CONFIG_TASK_NAME_SIZE > 0 && <-- The task has a name
* (defined(CONFIG_DEBUG_FEATURES) || <-- And the debug is enabled (llerr used)
* defined(CONFIG_ARCH_STACKDUMP)) <-- Or lowsyslog() is used
*/
#undef CONFIG_PRINT_TASKNAME
#if CONFIG_TASK_NAME_SIZE > 0 && (defined(CONFIG_DEBUG_FEATURES) || defined(CONFIG_ARCH_STACKDUMP))
# define CONFIG_PRINT_TASKNAME 1
#endif
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
@ -163,17 +131,17 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg)
void up_assert(const uint8_t *filename, int lineno)
{
#ifdef CONFIG_PRINT_TASKNAME
#if CONFIG_TASK_NAME_SIZE > 0
struct tcb_s *rtcb = this_task();
#endif
board_autoled_on(LED_ASSERTION);
#ifdef CONFIG_PRINT_TASKNAME
llerr("Assertion failed at file:%s line: %d task: %s\n",
#if CONFIG_TASK_NAME_SIZE > 0
alert("Assertion failed at file:%s line: %d task: %s\n",
filename, lineno, rtcb->name);
#else
llerr("Assertion failed at file:%s line: %d\n",
alert("Assertion failed at file:%s line: %d\n",
filename, lineno);
#endif

View File

@ -1,7 +1,7 @@
/****************************************************************************
* arch/hc/src/m9s12/m9s12_assert.c
*
* Copyright (C) 2011-2015 Gregory Nutt. All rights reserved.
* Copyright (C) 2011-2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -39,21 +39,6 @@
#include <nuttx/config.h>
/* Output debug info if stack dump is selected -- even if debug is not
* selected.
*/
#ifdef CONFIG_ARCH_STACKDUMP
# undef CONFIG_DEBUG_FEATURES
# undef CONFIG_DEBUG_ERROR
# undef CONFIG_DEBUG_WARN
# undef CONFIG_DEBUG_INFO
# define CONFIG_DEBUG_FEATURES 1
# define CONFIG_DEBUG_ERROR 1
# define CONFIG_DEBUG_WARN 1
# define CONFIG_DEBUG_INFO 1
#endif
#include <stdint.h>
#include <stdlib.h>
#include <assert.h>
@ -79,23 +64,6 @@
# undef CONFIG_ARCH_USBDUMP
#endif
/* The following is just intended to keep some ugliness out of the mainline
* code. We are going to print the task name if:
*
* CONFIG_TASK_NAME_SIZE > 0 && <-- The task has a name
* (defined(CONFIG_DEBUG_FEATURES) || <-- And the debug is enabled (llerr used)
* defined(CONFIG_ARCH_STACKDUMP) <-- Or lowsyslog() is used
*/
#undef CONFIG_PRINT_TASKNAME
#if CONFIG_TASK_NAME_SIZE > 0 && (defined(CONFIG_DEBUG_FEATURES) || defined(CONFIG_ARCH_STACKDUMP))
# define CONFIG_PRINT_TASKNAME 1
#endif
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
@ -112,7 +80,7 @@ static void up_stackdump(uint16_t sp, uint16_t stack_base)
for (stack = sp; stack < stack_base; stack += 16)
{
uint8_t *ptr = (uint8_t*)stack;
llerr("%04x: %02x %02x %02x %02x %02x %02x %02x %02x"
alert("%04x: %02x %02x %02x %02x %02x %02x %02x %02x"
" %02x %02x %02x %02x %02x %02x %02x %02x\n",
stack, ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], ptr[5], ptr[6], ptr[7],
ptr[8], ptr[9], ptr[10], ptr[11], ptr[12], ptr[13], ptr[14], ptr[15]);
@ -133,11 +101,11 @@ static inline void up_registerdump(void)
if (g_current_regs)
{
llerr("A:%02x B:%02x X:%02x%02x Y:%02x%02x PC:%02x%02x CCR:%02x\n",
alert("A:%02x B:%02x X:%02x%02x Y:%02x%02x PC:%02x%02x CCR:%02x\n",
g_current_regs[REG_A], g_current_regs[REG_B], g_current_regs[REG_XH],
g_current_regs[REG_XL], g_current_regs[REG_YH], g_current_regs[REG_YL],
g_current_regs[REG_PCH], g_current_regs[REG_PCL], g_current_regs[REG_CCR]);
llerr("SP:%02x%02x FRAME:%02x%02x TMP:%02x%02x Z:%02x%02x XY:%02x\n",
alert("SP:%02x%02x FRAME:%02x%02x TMP:%02x%02x Z:%02x%02x XY:%02x\n",
g_current_regs[REG_SPH], g_current_regs[REG_SPL],
g_current_regs[REG_FRAMEH], g_current_regs[REG_FRAMEL],
g_current_regs[REG_TMPL], g_current_regs[REG_TMPH], g_current_regs[REG_ZL],
@ -146,16 +114,16 @@ static inline void up_registerdump(void)
#if CONFIG_HCS12_MSOFTREGS > 2
# error "Need to save more registers"
#elif CONFIG_HCS12_MSOFTREGS == 2
llerr("SOFTREGS: %02x%02x :%02x%02x\n",
alert("SOFTREGS: %02x%02x :%02x%02x\n",
g_current_regs[REG_SOFTREG1], g_current_regs[REG_SOFTREG1+1],
g_current_regs[REG_SOFTREG2], g_current_regs[REG_SOFTREG2+1]);
#elif CONFIG_HCS12_MSOFTREGS == 1
llerr("SOFTREGS: %02x%02x\n", g_current_regs[REG_SOFTREG1],
alert("SOFTREGS: %02x%02x\n", g_current_regs[REG_SOFTREG1],
g_current_regs[REG_SOFTREG1+1]);
#endif
#ifndef CONFIG_HCS12_NONBANKED
llerr("PPAGE: %02x\n", g_current_regs[REG_PPAGE],);
alert("PPAGE: %02x\n", g_current_regs[REG_PPAGE],);
#endif
}
}
@ -225,10 +193,10 @@ static void up_dumpstate(void)
/* Show interrupt stack info */
llerr("sp: %04x\n", sp);
llerr("IRQ stack:\n");
llerr(" base: %04x\n", istackbase);
llerr(" size: %04x\n", istacksize);
alert("sp: %04x\n", sp);
alert("IRQ stack:\n");
alert(" base: %04x\n", istackbase);
alert(" size: %04x\n", istacksize);
/* Does the current stack pointer lie within the interrupt
* stack?
@ -245,18 +213,18 @@ static void up_dumpstate(void)
*/
sp = g_intstackbase;
llerr("sp: %04x\n", sp);
alert("sp: %04x\n", sp);
}
/* Show user stack info */
llerr("User stack:\n");
llerr(" base: %04x\n", ustackbase);
llerr(" size: %04x\n", ustacksize);
alert("User stack:\n");
alert(" base: %04x\n", ustackbase);
alert(" size: %04x\n", ustacksize);
#else
llerr("sp: %04x\n", sp);
llerr("stack base: %04x\n", ustackbase);
llerr("stack size: %04x\n", ustacksize);
alert("sp: %04x\n", sp);
alert("stack base: %04x\n", ustackbase);
alert("stack size: %04x\n", ustacksize);
#endif
/* Dump the user stack if the stack pointer lies within the allocated user
@ -266,7 +234,7 @@ static void up_dumpstate(void)
if (sp > ustackbase || sp <= ustackbase - ustacksize)
{
#if !defined(CONFIG_ARCH_INTERRUPTSTACK) || CONFIG_ARCH_INTERRUPTSTACK < 4
llerr("ERROR: Stack pointer is not within allocated stack\n");
alert("ERROR: Stack pointer is not within allocated stack\n");
#endif
}
else
@ -326,17 +294,17 @@ static void _up_assert(int errorcode)
void up_assert(const uint8_t *filename, int lineno)
{
#ifdef CONFIG_PRINT_TASKNAME
#if CONFIG_TASK_NAME_SIZE > 0
struct tcb_s *rtcb = this_task();
#endif
board_autoled_on(LED_ASSERTION);
#ifdef CONFIG_PRINT_TASKNAME
llerr("Assertion failed at file:%s line: %d task: %s\n",
#if CONFIG_TASK_NAME_SIZE > 0
alert("Assertion failed at file:%s line: %d task: %s\n",
filename, lineno, rtcb->name);
#else
llerr("Assertion failed at file:%s line: %d\n",
alert("Assertion failed at file:%s line: %d\n",
filename, lineno);
#endif

View File

@ -1,8 +1,7 @@
/****************************************************************************
* arch/arm/src/m9s12/m9s12_dumpgpio.c
* arch/arm/src/chip/m9s12_dumpgpio.c
*
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
* Copyright (C) 2011, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -43,12 +42,8 @@
/* Output debug info -- even if debug is not selected. */
#undef CONFIG_DEBUG_FEATURES
#undef CONFIG_DEBUG_ERROR
#undef CONFIG_DEBUG_WARN
#undef CONFIG_DEBUG_INFO
#define CONFIG_DEBUG_FEATURES 1
#define CONFIG_DEBUG_ERROR 1
#define CONFIG_DEBUG_WARN 1
#define CONFIG_DEBUG_INFO 1
#include <stdint.h>
@ -177,39 +172,39 @@ static inline void hcs12_pimdump(uint8_t portndx)
if (portndx >= HCS12_PIM_NPORTS)
{
llerr(" Illegal PIM port index: %d\n", portndx);
llinfo(" Illegal PIM port index: %d\n", portndx);
return;
}
ptr = &piminfo[portndx];
llerr(" PIM Port%c:\n", ptr->name);
llerr(" IO:%02x INP:%02x DDR:%02x RDR:%02x\n",
getreg8(ptr->base+HCS12_PIM_IO_OFFSET),
getreg8(ptr->base+HCS12_PIM_INPUT_OFFSET),
getreg8(ptr->base+HCS12_PIM_DDR_OFFSET),
getreg8(ptr->base+HCS12_PIM_RDR_OFFSET));
llinfo(" PIM Port%c:\n", ptr->name);
llinfo(" IO:%02x INP:%02x DDR:%02x RDR:%02x\n",
getreg8(ptr->base+HCS12_PIM_IO_OFFSET),
getreg8(ptr->base+HCS12_PIM_INPUT_OFFSET),
getreg8(ptr->base+HCS12_PIM_DDR_OFFSET),
getreg8(ptr->base+HCS12_PIM_RDR_OFFSET));
switch (ptr->form)
{
case PIMPORT_FORM1:
llerr(" PER:%02x PS:%02x\n",
getreg8(ptr->base+HCS12_PIM_PER_OFFSET),
getreg8(ptr->base+HCS12_PIM_PS_OFFSET));
llinfo(" PER:%02x PS:%02x\n",
getreg8(ptr->base+HCS12_PIM_PER_OFFSET),
getreg8(ptr->base+HCS12_PIM_PS_OFFSET));
break;
case PIMPORT_FORM2:
llerr(" PER:%02x PS:%02x WOM:%02x\n",
getreg8(ptr->base+HCS12_PIM_PER_OFFSET),
getreg8(ptr->base+HCS12_PIM_PS_OFFSET),
getreg8(ptr->base+HCS12_PIM_WOM_OFFSET));
llinfo(" PER:%02x PS:%02x WOM:%02x\n",
getreg8(ptr->base+HCS12_PIM_PER_OFFSET),
getreg8(ptr->base+HCS12_PIM_PS_OFFSET),
getreg8(ptr->base+HCS12_PIM_WOM_OFFSET));
break;
case PIMPORT_FORM3:
llerr(" PER:%02x PS:%02x IE:%02x IF:%02x\n",
getreg8(ptr->base+HCS12_PIM_PER_OFFSET),
getreg8(ptr->base+HCS12_PIM_PS_OFFSET),
getreg8(ptr->base+HCS12_PIM_IE_OFFSET),
getreg8(ptr->base+HCS12_PIM_IF_OFFSET));
llinfo(" PER:%02x PS:%02x IE:%02x IF:%02x\n",
getreg8(ptr->base+HCS12_PIM_PER_OFFSET),
getreg8(ptr->base+HCS12_PIM_PS_OFFSET),
getreg8(ptr->base+HCS12_PIM_IE_OFFSET),
getreg8(ptr->base+HCS12_PIM_IF_OFFSET));
break;
default:
@ -231,30 +226,30 @@ static inline void hcs12_mebidump(uint8_t portndx)
if (portndx >= HCS12_MEBI_NPORTS)
{
llerr(" Illegal MEBI port index: %d\n", portndx);
llinfo(" Illegal MEBI port index: %d\n", portndx);
return;
}
ptr = &mebiinfo[portndx];
llerr(" MEBI Port%c:\n", ptr->name);
llinfo(" MEBI Port%c:\n", ptr->name);
switch (ptr->form)
{
case MEBIPORT_AB:
llerr(" DATA:%02x DDR:%02x\n",
llinfo(" DATA:%02x DDR:%02x\n",
getreg8(ptr->data), getreg8(ptr->ddr));
break;
case MEBIPORT_E:
llerr(" DATA:%02x DDR:%02x MODE:%02x PEAR:%02x\n",
getreg8(ptr->data), getreg8(ptr->ddr),
getreg8(HCS12_MEBI_MODE), getreg8(HCS12_MEBI_PEAR));
llinfo(" DATA:%02x DDR:%02x MODE:%02x PEAR:%02x\n",
getreg8(ptr->data), getreg8(ptr->ddr),
getreg8(HCS12_MEBI_MODE), getreg8(HCS12_MEBI_PEAR));
break;
case MEBIPORT_K:
llerr(" DATA:%02x DDR:%02x MODE:%02x\n",
getreg8(ptr->data), getreg8(ptr->ddr),
getreg8(HCS12_MEBI_MODE));
llinfo(" DATA:%02x DDR:%02x MODE:%02x\n",
getreg8(ptr->data), getreg8(ptr->ddr),
getreg8(HCS12_MEBI_MODE));
break;
default:
@ -279,7 +274,7 @@ int hcs12_dumpgpio(uint16_t pinset, const char *msg)
uint8_t portndx = HCS12_PORTNDX(pinset);
irqstate_t flags = enter_critical_section();
llerr("pinset: %08x -- %s\n", pinset, msg);
llinfo("pinset: %08x -- %s\n", pinset, msg);
if (HCS12_PIMPORT(pinset))
{
@ -295,4 +290,3 @@ int hcs12_dumpgpio(uint16_t pinset, const char *msg)
}
#endif /* CONFIG_DEBUG_GPIO */

View File

@ -39,21 +39,6 @@
#include <nuttx/config.h>
/* Output debug info if stack dump is selected -- even if debug is not
* selected.
*/
#ifdef CONFIG_ARCH_STACKDUMP
# undef CONFIG_DEBUG_FEATURES
# undef CONFIG_DEBUG_ERROR
# undef CONFIG_DEBUG_WARN
# undef CONFIG_DEBUG_INFO
# define CONFIG_DEBUG_FEATURES 1
# define CONFIG_DEBUG_ERROR 1
# define CONFIG_DEBUG_WARN 1
# define CONFIG_DEBUG_INFO 1
#endif
#include <stdint.h>
#include <stdlib.h>
#include <assert.h>
@ -79,23 +64,6 @@
# undef CONFIG_ARCH_USBDUMP
#endif
/* The following is just intended to keep some ugliness out of the mainline
* code. We are going to print the task name if:
*
* CONFIG_TASK_NAME_SIZE > 0 && <-- The task has a name
* (defined(CONFIG_DEBUG_FEATURES) || <-- And the debug is enabled (llerr used)
* defined(CONFIG_ARCH_STACKDUMP) <-- Or lowsyslog() is used
*/
#undef CONFIG_PRINT_TASKNAME
#if CONFIG_TASK_NAME_SIZE > 0 && (defined(CONFIG_DEBUG_FEATURES) || defined(CONFIG_ARCH_STACKDUMP))
# define CONFIG_PRINT_TASKNAME 1
#endif
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
@ -163,17 +131,17 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg)
void up_assert(const uint8_t *filename, int lineno)
{
#ifdef CONFIG_PRINT_TASKNAME
#if CONFIG_TASK_NAME_SIZE > 0
struct tcb_s *rtcb = this_task();
#endif
board_autoled_on(LED_ASSERTION);
#ifdef CONFIG_PRINT_TASKNAME
llerr("Assertion failed at file:%s line: %d task: %s\n",
#if CONFIG_TASK_NAME_SIZE > 0
alert("Assertion failed at file:%s line: %d task: %s\n",
filename, lineno, rtcb->name);
#else
llerr("Assertion failed at file:%s line: %d\n",
alert("Assertion failed at file:%s line: %d\n",
filename, lineno);
#endif

View File

@ -39,17 +39,6 @@
#include <nuttx/config.h>
/* Output debug info -- even if debug is not selected. */
#undef CONFIG_DEBUG_FEATURES
#undef CONFIG_DEBUG_ERROR
#undef CONFIG_DEBUG_WARN
#undef CONFIG_DEBUG_INFO
#define CONFIG_DEBUG_FEATURES 1
#define CONFIG_DEBUG_ERROR 1
#define CONFIG_DEBUG_WARN 1
#define CONFIG_DEBUG_INFO 1
#include <stdint.h>
#include <stdlib.h>
#include <assert.h>
@ -97,7 +86,7 @@ static void up_stackdump(uint32_t sp, uint32_t stack_base)
for (stack = sp & ~0x1f; stack < stack_base; stack += 32)
{
uint32_t *ptr = (uint32_t *)stack;
llerr("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
alert("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
stack, ptr[0], ptr[1], ptr[2], ptr[3],
ptr[4], ptr[5], ptr[6], ptr[7]);
}
@ -113,27 +102,27 @@ static inline void up_registerdump(void)
if (g_current_regs)
{
llerr("MFLO:%08x MFHI:%08x EPC:%08x STATUS:%08x\n",
alert("MFLO:%08x MFHI:%08x EPC:%08x STATUS:%08x\n",
g_current_regs[REG_MFLO], g_current_regs[REG_MFHI], g_current_regs[REG_EPC],
g_current_regs[REG_STATUS]);
llerr("AT:%08x V0:%08x V1:%08x A0:%08x A1:%08x A2:%08x A3:%08x\n",
alert("AT:%08x V0:%08x V1:%08x A0:%08x A1:%08x A2:%08x A3:%08x\n",
g_current_regs[REG_AT], g_current_regs[REG_V0], g_current_regs[REG_V1],
g_current_regs[REG_A0], g_current_regs[REG_A1], g_current_regs[REG_A2],
g_current_regs[REG_A3]);
llerr("T0:%08x T1:%08x T2:%08x T3:%08x T4:%08x T5:%08x T6:%08x T7:%08x\n",
alert("T0:%08x T1:%08x T2:%08x T3:%08x T4:%08x T5:%08x T6:%08x T7:%08x\n",
g_current_regs[REG_T0], g_current_regs[REG_T1], g_current_regs[REG_T2],
g_current_regs[REG_T3], g_current_regs[REG_T4], g_current_regs[REG_T5],
g_current_regs[REG_T6], g_current_regs[REG_T7]);
llerr("S0:%08x S1:%08x S2:%08x S3:%08x S4:%08x S5:%08x S6:%08x S7:%08x\n",
alert("S0:%08x S1:%08x S2:%08x S3:%08x S4:%08x S5:%08x S6:%08x S7:%08x\n",
g_current_regs[REG_S0], g_current_regs[REG_S1], g_current_regs[REG_S2],
g_current_regs[REG_S3], g_current_regs[REG_S4], g_current_regs[REG_S5],
g_current_regs[REG_S6], g_current_regs[REG_S7]);
#ifdef MIPS32_SAVE_GP
llerr("T8:%08x T9:%08x GP:%08x SP:%08x FP:%08x RA:%08x\n",
alert("T8:%08x T9:%08x GP:%08x SP:%08x FP:%08x RA:%08x\n",
g_current_regs[REG_T8], g_current_regs[REG_T9], g_current_regs[REG_GP],
g_current_regs[REG_SP], g_current_regs[REG_FP], g_current_regs[REG_RA]);
#else
llerr("T8:%08x T9:%08x SP:%08x FP:%08x RA:%08x\n",
alert("T8:%08x T9:%08x SP:%08x FP:%08x RA:%08x\n",
g_current_regs[REG_T8], g_current_regs[REG_T9], g_current_regs[REG_SP],
g_current_regs[REG_FP], g_current_regs[REG_RA]);
#endif
@ -180,10 +169,10 @@ void up_dumpstate(void)
/* Show interrupt stack info */
llerr("sp: %08x\n", sp);
llerr("IRQ stack:\n");
llerr(" base: %08x\n", istackbase);
llerr(" size: %08x\n", istacksize);
alert("sp: %08x\n", sp);
alert("IRQ stack:\n");
alert(" base: %08x\n", istackbase);
alert(" size: %08x\n", istacksize);
/* Does the current stack pointer lie within the interrupt
* stack?
@ -200,18 +189,18 @@ void up_dumpstate(void)
*/
sp = g_intstackbase;
llerr("sp: %08x\n", sp);
alert("sp: %08x\n", sp);
}
/* Show user stack info */
llerr("User stack:\n");
llerr(" base: %08x\n", ustackbase);
llerr(" size: %08x\n", ustacksize);
alert("User stack:\n");
alert(" base: %08x\n", ustackbase);
alert(" size: %08x\n", ustacksize);
#else
llerr("sp: %08x\n", sp);
llerr("stack base: %08x\n", ustackbase);
llerr("stack size: %08x\n", ustacksize);
alert("sp: %08x\n", sp);
alert("stack base: %08x\n", ustackbase);
alert("stack size: %08x\n", ustacksize);
#endif
/* Dump the user stack if the stack pointer lies within the allocated user
@ -221,7 +210,7 @@ void up_dumpstate(void)
if (sp > ustackbase || sp <= ustackbase - ustacksize)
{
#if !defined(CONFIG_ARCH_INTERRUPTSTACK) || CONFIG_ARCH_INTERRUPTSTACK < 4
llerr("ERROR: Stack pointer is not within allocated stack\n");
alert("ERROR: Stack pointer is not within allocated stack\n");
#endif
}
else

View File

@ -1,7 +1,7 @@
/****************************************************************************
* arch/sh/src/common/up_assert.c
*
* Copyright (C) 2008-2009, 2012-2015 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-2009, 2012-2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -39,21 +39,6 @@
#include <nuttx/config.h>
/* Output debug info if stack dump is selected -- even if debug is not
* selected.
*/
#ifdef CONFIG_ARCH_STACKDUMP
# undef CONFIG_DEBUG_FEATURES
# undef CONFIG_DEBUG_ERROR
# undef CONFIG_DEBUG_WARN
# undef CONFIG_DEBUG_INFO
# define CONFIG_DEBUG_FEATURES 1
# define CONFIG_DEBUG_ERROR 1
# define CONFIG_DEBUG_WARN 1
# define CONFIG_DEBUG_INFO 1
#endif
#include <stdint.h>
#include <stdlib.h>
#include <assert.h>
@ -80,10 +65,6 @@
# undef CONFIG_ARCH_USBDUMP
#endif
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
@ -151,17 +132,17 @@ 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
struct tcb_s *rtcb = this_task();
#endif
board_autoled_on(LED_ASSERTION);
#if CONFIG_TASK_NAME_SIZE > 0
llerr("Assertion failed at file:%s line: %d task: %s\n",
alert("Assertion failed at file:%s line: %d task: %s\n",
filename, lineno, rtcb->name);
#else
llerr("Assertion failed at file:%s line: %d\n",
alert("Assertion failed at file:%s line: %d\n",
filename, lineno);
#endif

View File

@ -1,7 +1,7 @@
/****************************************************************************
* arch/sh/src/m16c/m16c_assert.c
*
* Copyright (C) 2009 Gregory Nutt. All rights reserved.
* Copyright (C) 2009, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -39,17 +39,6 @@
#include <nuttx/config.h>
/* Output debug info -- even if debug is not selected. */
#undef CONFIG_DEBUG_FEATURES
#undef CONFIG_DEBUG_ERROR
#undef CONFIG_DEBUG_WARN
#undef CONFIG_DEBUG_INFO
#define CONFIG_DEBUG_FEATURES 1
#define CONFIG_DEBUG_ERROR 1
#define CONFIG_DEBUG_WARN 1
#define CONFIG_DEBUG_INFO 1
#include <stdint.h>
#include <debug.h>
@ -63,14 +52,6 @@
#ifdef CONFIG_ARCH_STACKDUMP
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
@ -116,7 +97,7 @@ static void m16c_stackdump(uint16_t sp, uint16_t stack_base)
for (stack = sp & ~7; stack < stack_base; stack += 8)
{
uint8_t *ptr = (uint8_t*)stack;
llerr("%04x: %02x %02x %02x %02x %02x %02x %02x %02x\n",
alert("%04x: %02x %02x %02x %02x %02x %02x %02x %02x\n",
stack, ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], ptr[5], ptr[6], ptr[7]);
}
}
@ -135,14 +116,14 @@ static inline void m16c_registerdump(void)
{
/* Yes.. dump the interrupt registers */
llerr("PC: %02x%02x%02x FLG: %02x00%02x FB: %02x%02x SB: %02x%02x SP: %02x%02x\n",
alert("PC: %02x%02x%02x FLG: %02x00%02x FB: %02x%02x SB: %02x%02x SP: %02x%02x\n",
ptr[REG_FLGPCHI] & 0xff, ptr[REG_PC], ptr[REG_PC+1],
ptr[REG_FLGPCHI] >> 8, ptr[REG_FLG],
ptr[REG_FB], ptr[REG_FB+1],
ptr[REG_SB], ptr[REG_SB+1],
ptr[REG_SP], ptr[REG_SP+1]);
llerr("R0: %02x%02x R1: %02x%02x R2: %02x%02x A0: %02x%02x A1: %02x%02x\n",
alert("R0: %02x%02x R1: %02x%02x R2: %02x%02x A0: %02x%02x A1: %02x%02x\n",
ptr[REG_R0], ptr[REG_R0+1], ptr[REG_R1], ptr[REG_R1+1],
ptr[REG_R2], ptr[REG_R2+1], ptr[REG_R3], ptr[REG_R3+1],
ptr[REG_A0], ptr[REG_A0+1], ptr[REG_A1], ptr[REG_A1+1]);
@ -198,10 +179,10 @@ void up_dumpstate(void)
/* Show interrupt stack info */
llerr("sp: %04x\n", sp);
llerr("IRQ stack:\n");
llerr(" base: %04x\n", istackbase);
llerr(" size: %04x\n", istacksize);
alert("sp: %04x\n", sp);
alert("IRQ stack:\n");
alert(" base: %04x\n", istackbase);
alert(" size: %04x\n", istacksize);
/* Does the current stack pointer lie within the interrupt
* stack?
@ -216,18 +197,18 @@ void up_dumpstate(void)
/* Extract the user stack pointer from the register area */
sp = m16c_getusersp();
llerr("sp: %04x\n", sp);
alert("sp: %04x\n", sp);
}
/* Show user stack info */
llerr("User stack:\n");
llerr(" base: %04x\n", ustackbase);
llerr(" size: %04x\n", ustacksize);
alert("User stack:\n");
alert(" base: %04x\n", ustackbase);
alert(" size: %04x\n", ustacksize);
#else
llerr("sp: %04x\n", sp);
llerr("stack base: %04x\n", ustackbase);
llerr("stack size: %04x\n", ustacksize);
alert("sp: %04x\n", sp);
alert("stack base: %04x\n", ustackbase);
alert("stack size: %04x\n", ustacksize);
#endif
/* Dump the user stack if the stack pointer lies within the allocated user
@ -237,7 +218,7 @@ void up_dumpstate(void)
if (sp > ustackbase || sp <= ustackbase - ustacksize)
{
#if !defined(CONFIG_ARCH_INTERRUPTSTACK) || CONFIG_ARCH_INTERRUPTSTACK < 4
llerr("ERROR: Stack pointer is not within allocated stack\n");
alert("ERROR: Stack pointer is not within allocated stack\n");
#endif
}
else

View File

@ -1,7 +1,7 @@
/****************************************************************************
* arch/sh/src/sh1/sh1_assert.c
*
* Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-2009, 2011, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -39,17 +39,6 @@
#include <nuttx/config.h>
/* Output debug info -- even if debug is not selected. */
#undef CONFIG_DEBUG_FEATURES
#undef CONFIG_DEBUG_ERROR
#undef CONFIG_DEBUG_WARN
#undef CONFIG_DEBUG_INFO
#define CONFIG_DEBUG_FEATURES 1
#define CONFIG_DEBUG_ERROR 1
#define CONFIG_DEBUG_WARN 1
#define CONFIG_DEBUG_INFO 1
#include <stdint.h>
#include <debug.h>
@ -62,14 +51,6 @@
#ifdef CONFIG_ARCH_STACKDUMP
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
@ -103,7 +84,7 @@ static void sh1_stackdump(uint32_t sp, uint32_t stack_base)
for (stack = sp & ~0x1f; stack < stack_base; stack += 32)
{
uint32_t *ptr = (uint32_t*)stack;
llerr("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
alert("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
stack, ptr[0], ptr[1], ptr[2], ptr[3],
ptr[4], ptr[5], ptr[6], ptr[7]);
}
@ -123,17 +104,17 @@ static inline void sh1_registerdump(void)
{
/* Yes.. dump the interrupt registers */
llerr("PC: %08x SR=%08x\n",
alert("PC: %08x SR=%08x\n",
ptr[REG_PC], ptr[REG_SR]);
llerr("PR: %08x GBR: %08x MACH: %08x MACL: %08x\n",
alert("PR: %08x GBR: %08x MACH: %08x MACL: %08x\n",
ptr[REG_PR], ptr[REG_GBR], ptr[REG_MACH], ptr[REG_MACL]);
llerr("R%d: %08x %08x %08x %08x %08x %08x %08x %08x\n", 0,
alert("R%d: %08x %08x %08x %08x %08x %08x %08x %08x\n", 0,
ptr[REG_R0], ptr[REG_R1], ptr[REG_R2], ptr[REG_R3],
ptr[REG_R4], ptr[REG_R5], ptr[REG_R6], ptr[REG_R7]);
llerr("R%d: %08x %08x %08x %08x %08x %08x %08x %08x\n", 8,
alert("R%d: %08x %08x %08x %08x %08x %08x %08x %08x\n", 8,
ptr[REG_R8], ptr[REG_R9], ptr[REG_R10], ptr[REG_R11],
ptr[REG_R12], ptr[REG_R13], ptr[REG_R14], ptr[REG_R15]);
}
@ -179,10 +160,10 @@ void up_dumpstate(void)
/* Show interrupt stack info */
llerr("sp: %08x\n", sp);
llerr("IRQ stack:\n");
llerr(" base: %08x\n", istackbase);
llerr(" size: %08x\n", istacksize);
alert("sp: %08x\n", sp);
alert("IRQ stack:\n");
alert(" base: %08x\n", istackbase);
alert(" size: %08x\n", istacksize);
/* Does the current stack pointer lie within the interrupt
* stack?
@ -199,18 +180,18 @@ void up_dumpstate(void)
*/
sp = g_intstackbase;
llerr("sp: %08x\n", sp);
alert("sp: %08x\n", sp);
}
/* Show user stack info */
llerr("User stack:\n");
llerr(" base: %08x\n", ustackbase);
llerr(" size: %08x\n", ustacksize);
alert("User stack:\n");
alert(" base: %08x\n", ustackbase);
alert(" size: %08x\n", ustacksize);
#else
llerr("sp: %08x\n", sp);
llerr("stack base: %08x\n", ustackbase);
llerr("stack size: %08x\n", ustacksize);
alert("sp: %08x\n", sp);
alert("stack base: %08x\n", ustackbase);
alert("stack size: %08x\n", ustacksize);
#endif
/* Dump the user stack if the stack pointer lies within the allocated user
@ -220,7 +201,7 @@ void up_dumpstate(void)
if (sp > ustackbase || sp <= ustackbase - ustacksize)
{
#if !defined(CONFIG_ARCH_INTERRUPTSTACK) || CONFIG_ARCH_INTERRUPTSTACK < 4
llerr("ERROR: Stack pointer is not within allocated stack\n");
alert("ERROR: Stack pointer is not within allocated stack\n");
#endif
}
else

View File

@ -1,7 +1,7 @@
/****************************************************************************
* arch/x86/src/common/up_assert.c
*
* Copyright (C) 2011-2015 Gregory Nutt. All rights reserved.
* Copyright (C) 2011-2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -39,21 +39,6 @@
#include <nuttx/config.h>
/* Output debug info if stack dump is selected -- even if debug is not
* selected.
*/
#ifdef CONFIG_ARCH_STACKDUMP
# undef CONFIG_DEBUG_FEATURES
# undef CONFIG_DEBUG_ERROR
# undef CONFIG_DEBUG_WARN
# undef CONFIG_DEBUG_INFO
# define CONFIG_DEBUG_FEATURES 1
# define CONFIG_DEBUG_ERROR 1
# define CONFIG_DEBUG_WARN 1
# define CONFIG_DEBUG_INFO 1
#endif
#include <stdint.h>
#include <stdlib.h>
#include <assert.h>
@ -80,19 +65,6 @@
# undef CONFIG_ARCH_USBDUMP
#endif
/* The following is just intended to keep some ugliness out of the mainline
* code. We are going to print the task name if:
*
* CONFIG_TASK_NAME_SIZE > 0 && <-- The task has a name
* (defined(CONFIG_DEBUG_FEATURES) || <-- And the debug is enabled (llerr used)
* defined(CONFIG_ARCH_STACKDUMP) <-- Or lowsyslog() is used
*/
#undef CONFIG_PRINT_TASKNAME
#if CONFIG_TASK_NAME_SIZE > 0 && (defined(CONFIG_DEBUG_FEATURES) || defined(CONFIG_ARCH_STACKDUMP))
# define CONFIG_PRINT_TASKNAME 1
#endif
/****************************************************************************
* Private Functions
****************************************************************************/
@ -284,13 +256,13 @@ static void _up_assert(int errorcode)
void up_assert(const uint8_t *filename, int lineno)
{
#ifdef CONFIG_PRINT_TASKNAME
#if CONFIG_TASK_NAME_SIZE > 0
struct tcb_s *rtcb = this_task();
#endif
board_autoled_on(LED_ASSERTION);
#ifdef CONFIG_PRINT_TASKNAME
#if CONFIG_TASK_NAME_SIZE > 0
llerr("Assertion failed at file:%s line: %d task: %s\n",
filename, lineno, rtcb->name);
#else

View File

@ -1,7 +1,7 @@
/****************************************************************************
* arch/x86/src/i486/up_regdump.c
*
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
* Copyright (C) 2011, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -39,50 +39,28 @@
#include <nuttx/config.h>
/* Output debug info -- even if debug is not selected. */
#undef CONFIG_DEBUG_FEATURES
#undef CONFIG_DEBUG_ERROR
#undef CONFIG_DEBUG_WARN
#undef CONFIG_DEBUG_INFO
#define CONFIG_DEBUG_FEATURES 1
#define CONFIG_DEBUG_ERROR 1
#define CONFIG_DEBUG_WARN 1
#define CONFIG_DEBUG_INFO 1
#include <debug.h>
#include <nuttx/irq.h>
#include "up_internal.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: up_registerdump
****************************************************************************/
void up_registerdump(uint32_t *regs)
{
llerr(" ds:%08x irq:%08x err:%08x\n",
alert(" ds:%08x irq:%08x err:%08x\n",
regs[REG_DS], regs[REG_IRQNO], regs[REG_ERRCODE]);
llerr("edi:%08x esi:%08x ebp:%08x esp:%08x\n",
alert("edi:%08x esi:%08x ebp:%08x esp:%08x\n",
regs[REG_EDI], regs[REG_ESI], regs[REG_EBP], regs[REG_ESP]);
llerr("ebx:%08x edx:%08x ecx:%08x eax:%08x\n",
alert("ebx:%08x edx:%08x ecx:%08x eax:%08x\n",
regs[REG_EBX], regs[REG_EDX], regs[REG_ECX], regs[REG_EAX]);
llerr("eip:%08x cs:%08x flg:%08x sp:%08x ss:%08x\n",
alert("eip:%08x cs:%08x flg:%08x sp:%08x ss:%08x\n",
regs[REG_EIP], regs[REG_CS], regs[REG_EFLAGS], regs[REG_SP],
regs[REG_SS]);
}

View File

@ -1,7 +1,7 @@
/****************************************************************************
* common/up_assert.c
*
* Copyright (C) 2008-2009, 2012-2015 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-2009, 2012-2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -39,21 +39,6 @@
#include <nuttx/config.h>
/* Output debug info if stack dump is selected -- even if debug is not
* selected.
*/
#ifdef CONFIG_ARCH_STACKDUMP
# undef CONFIG_DEBUG_FEATURES
# undef CONFIG_DEBUG_ERROR
# undef CONFIG_DEBUG_WARN
# undef CONFIG_DEBUG_INFO
# define CONFIG_DEBUG_FEATURES 1
# define CONFIG_DEBUG_ERROR 1
# define CONFIG_DEBUG_WARN 1
# define CONFIG_DEBUG_INFO 1
#endif
#include <stdint.h>
#include <stdlib.h>
#include <assert.h>
@ -158,17 +143,17 @@ void up_assert(void)
#ifdef CONFIG_HAVE_FILENAME
#if CONFIG_TASK_NAME_SIZE > 0
llerr("Assertion failed at file:%s line: %d task: %s\n",
alert("Assertion failed at file:%s line: %d task: %s\n",
filename, lineno, rtcb->name);
#else
llerr("Assertion failed at file:%s line: %d\n",
alert("Assertion failed at file:%s line: %d\n",
filename, lineno);
#endif
#else
#if CONFIG_TASK_NAME_SIZE > 0
llerr("Assertion failed: task: %s\n", rtcb->name);
alert("Assertion failed: task: %s\n", rtcb->name);
#else
llerr("Assertion failed\n");
alert("Assertion failed\n");
#endif
#endif

View File

@ -1,7 +1,7 @@
/****************************************************************************
* common/up_registerdump.c
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-2009, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -39,21 +39,6 @@
#include <nuttx/config.h>
/* Output debug info if stack dump is selected -- even if
* debug is not selected.
*/
#ifdef CONFIG_ARCH_STACKDUMP
# undef CONFIG_DEBUG_FEATURES
# undef CONFIG_DEBUG_ERROR
# undef CONFIG_DEBUG_WARN
# undef CONFIG_DEBUG_INFO
# define CONFIG_DEBUG_FEATURES 1
# define CONFIG_DEBUG_ERROR 1
# define CONFIG_DEBUG_WARN 1
# define CONFIG_DEBUG_INFO 1
#endif
#include <stdint.h>
#include <debug.h>
@ -77,15 +62,15 @@ static void up_registerdump(void)
#ifdef CONFIG_DEBUG_INFO
FAR uint32_t *regs32 = (FAR uint32_t*)g_current_regs;
llinfo("R0 :%08x R1 :%08x R2 :%08x R3 :%08x "
"R4 :%08x R5 :%08x R6 :%08x R7 :%08x\n"
regs32[REG_R0/2], regs32[REG_R1/2], regs32[REG_R2/2], regs32[REG_R3/2],
regs32[REG_R4/2], regs32[REG_R5/2], regs32[REG_R6/2], regs32[REG_R7/2]);
llinfo("R8 :%08x R9 :%08x R10:%08x R11:%08x R12:%08x R13:%08x\n"
regs32[REG_R8/2], regs32[REG_R9/2], regs32[REG_R10/2], regs3[REG_R11/2],
regs32[REG_R12/2], regs32[REG_R13/2]);
llinfo("FP :%08x SP :%08x FLG:%04x\n"
regs32[REG_R14/2], regs32[REG_R15/2], g_current_regs[REG_FLAGS]);
alert("R0 :%08x R1 :%08x R2 :%08x R3 :%08x "
"R4 :%08x R5 :%08x R6 :%08x R7 :%08x\n"
regs32[REG_R0/2], regs32[REG_R1/2], regs32[REG_R2/2], regs32[REG_R3/2],
regs32[REG_R4/2], regs32[REG_R5/2], regs32[REG_R6/2], regs32[REG_R7/2]);
alert("R8 :%08x R9 :%08x R10:%08x R11:%08x R12:%08x R13:%08x\n"
regs32[REG_R8/2], regs32[REG_R9/2], regs32[REG_R10/2], regs3[REG_R11/2],
regs32[REG_R12/2], regs32[REG_R13/2]);
alert("FP :%08x SP :%08x FLG:%04x\n"
regs32[REG_R14/2], regs32[REG_R15/2], g_current_regs[REG_FLAGS]);
#endif
}

View File

@ -1,7 +1,7 @@
/****************************************************************************
* common/up_stackdump.c
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-2009, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -39,17 +39,6 @@
#include <nuttx/config.h>
/* Output debug info -- even if debug is not selected. */
#undef CONFIG_DEBUG_FEATURES
#undef CONFIG_DEBUG_ERROR
#undef CONFIG_DEBUG_WARN
#undef CONFIG_DEBUG_INFO
#define CONFIG_DEBUG_FEATURES 1
#define CONFIG_DEBUG_ERROR 1
#define CONFIG_DEBUG_WARN 1
#define CONFIG_DEBUG_INFO 1
#include <debug.h>
#include "chip/chip.h"
@ -78,9 +67,9 @@ static void up_stackdump(void)
chipreg_t stack_base = (chipreg_t)rtcb->adj_stack_ptr;
chipreg_t stack_size = (chipreg_t)rtcb->adj_stack_size;
llinfo("stack_base: %08x\n", stack_base);
llinfo("stack_size: %08x\n", stack_size);
llinfo("sp: %08x\n", sp);
alert("stack_base: %08x\n", stack_base);
alert("stack_size: %08x\n", stack_size);
alert("sp: %08x\n", sp);
if (sp >= stack_base || sp < stack_base - stack_size)
{
@ -94,9 +83,9 @@ static void up_stackdump(void)
for (stack = sp & ~0x0f; stack < stack_base; stack += 8*sizeof(chipreg_t))
{
chipreg_t *ptr = (chipreg_t*)stack;
llinfo("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
stack, ptr[0], ptr[1], ptr[2], ptr[3],
ptr[4], ptr[5], ptr[6], ptr[7]);
alert("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
stack, ptr[0], ptr[1], ptr[2], ptr[3],
ptr[4], ptr[5], ptr[6], ptr[7]);
}
}
}

View File

@ -1,7 +1,7 @@
/****************************************************************************
* common/up_assert.c
*
* Copyright (C) 2007-2009, 2012-2015 Gregory Nutt. All rights reserved.
* Copyright (C) 2007-2009, 2012-2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -39,21 +39,6 @@
#include <nuttx/config.h>
/* Output debug info if stack dump is selected -- even if debug is not
* selected.
*/
#ifdef CONFIG_ARCH_STACKDUMP
# undef CONFIG_DEBUG_FEATURES
# undef CONFIG_DEBUG_ERROR
# undef CONFIG_DEBUG_WARN
# undef CONFIG_DEBUG_INFO
# define CONFIG_DEBUG_FEATURES 1
# define CONFIG_DEBUG_ERROR 1
# define CONFIG_DEBUG_WARN 1
# define CONFIG_DEBUG_INFO 1
#endif
#include <stdint.h>
#include <stdlib.h>
#include <assert.h>
@ -79,10 +64,6 @@
# undef CONFIG_ARCH_USBDUMP
#endif
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
@ -161,17 +142,17 @@ void up_assert(void)
#ifdef CONFIG_HAVE_FILENAME
#if CONFIG_TASK_NAME_SIZE > 0
llinfo("Assertion failed at file:%s line: %d task: %s\n",
filename, lineno, rtcb->name);
alert("Assertion failed at file:%s line: %d task: %s\n",
filename, lineno, rtcb->name);
#else
llinfo("Assertion failed at file:%s line: %d\n",
filename, lineno);
alert("Assertion failed at file:%s line: %d\n",
filename, lineno);
#endif
#else
#if CONFIG_TASK_NAME_SIZE > 0
llinfo("Assertion failed: task: %s\n", rtcb->name);
alert("Assertion failed: task: %s\n", rtcb->name);
#else
llinfo("Assertion failed\n");
alert("Assertion failed\n");
#endif
#endif

View File

@ -1,7 +1,7 @@
/****************************************************************************
* common/up_stackdump.c
*
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Copyright (C) 2007-2009, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -39,17 +39,6 @@
#include <nuttx/config.h>
/* Output debug info -- even if debug is not selected. */
#undef CONFIG_DEBUG_FEATURES
#undef CONFIG_DEBUG_ERROR
#undef CONFIG_DEBUG_WARN
#undef CONFIG_DEBUG_INFO
#define CONFIG_DEBUG_FEATURES 1
#define CONFIG_DEBUG_ERROR 1
#define CONFIG_DEBUG_WARN 1
#define CONFIG_DEBUG_INFO 1
#include <stdint.h>
#include <debug.h>
@ -59,14 +48,6 @@
#ifdef CONFIG_ARCH_STACKDUMP
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
@ -87,13 +68,13 @@ static void up_stackdump(void)
uint16_t stack_base = (uint16_t)rtcb->adj_stack_ptr;
uint16_t stack_size = (uint16_t)rtcb->adj_stack_size;
llinfo("stack_base: %04x\n", stack_base);
llinfo("stack_size: %04x\n", stack_size);
llinfo("sp: %04x\n", sp);
alert("stack_base: %04x\n", stack_base);
alert("stack_size: %04x\n", stack_size);
alert("sp: %04x\n", sp);
if (sp >= stack_base || sp < stack_base - stack_size)
{
llinfo("ERROR: Stack pointer is not within allocated stack\n");
alert("ERROR: Stack pointer is not within allocated stack\n");
return;
}
else
@ -103,9 +84,9 @@ static void up_stackdump(void)
for (stack = sp & ~0x0f; stack < stack_base; stack += 8*sizeof(uint16_t))
{
uint16_t *ptr = (uint16_t*)stack;
llinfo("%04x: %04x %04x %04x %04x %04x %04x %04x %04x\n",
stack, ptr[0], ptr[1], ptr[2], ptr[3],
ptr[4], ptr[5], ptr[6], ptr[7]);
alert("%04x: %04x %04x %04x %04x %04x %04x %04x %04x\n",
stack, ptr[0], ptr[1], ptr[2], ptr[3],
ptr[4], ptr[5], ptr[6], ptr[7]);
}
}
}

View File

@ -1,7 +1,7 @@
/****************************************************************************
* arch/z80/src/ez80/ez80_registerdump.c
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-2009, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -39,17 +39,6 @@
#include <nuttx/config.h>
/* Output debug info -- even if debug is not selected. */
#undef CONFIG_DEBUG_FEATURES
#undef CONFIG_DEBUG_ERROR
#undef CONFIG_DEBUG_WARN
#undef CONFIG_DEBUG_INFO
#define CONFIG_DEBUG_FEATURES 1
#define CONFIG_DEBUG_ERROR 1
#define CONFIG_DEBUG_WARN 1
#define CONFIG_DEBUG_INFO 1
#include <debug.h>
#include <nuttx/irq.h>
@ -81,23 +70,23 @@ static void ez80_registerdump(void)
if (g_current_regs)
{
#ifdef CONFIG_EZ80_Z80MODE
llinfo("AF: %04x I: %04x\n",
g_current_regs[XCPT_AF], g_current_regs[XCPT_I]);
llinfo("BC: %04x DE: %04x HL: %04x\n",
g_current_regs[XCPT_BC], g_current_regs[XCPT_DE], g_current_regs[XCPT_HL]);
llinfo("IX: %04x IY: %04x\n",
g_current_regs[XCPT_IX], g_current_regs[XCPT_IY]);
llinfo("SP: %04x PC: %04x\n"
g_current_regs[XCPT_SP], g_current_regs[XCPT_PC]);
alert("AF: %04x I: %04x\n",
g_current_regs[XCPT_AF], g_current_regs[XCPT_I]);
alert("BC: %04x DE: %04x HL: %04x\n",
g_current_regs[XCPT_BC], g_current_regs[XCPT_DE], g_current_regs[XCPT_HL]);
alert("IX: %04x IY: %04x\n",
g_current_regs[XCPT_IX], g_current_regs[XCPT_IY]);
alert("SP: %04x PC: %04x\n"
g_current_regs[XCPT_SP], g_current_regs[XCPT_PC]);
#else
llinfo("AF: %06x I: %06x\n",
g_current_regs[XCPT_AF], g_current_regs[XCPT_I]);
llinfo("BC: %06x DE: %06x HL: %06x\n",
g_current_regs[XCPT_BC], g_current_regs[XCPT_DE], g_current_regs[XCPT_HL]);
llinfo("IX: %06x IY: %06x\n",
g_current_regs[XCPT_IX], g_current_regs[XCPT_IY]);
llinfo("SP: %06x PC: %06x\n"
g_current_regs[XCPT_SP], g_current_regs[XCPT_PC]);
alert("AF: %06x I: %06x\n",
g_current_regs[XCPT_AF], g_current_regs[XCPT_I]);
alert("BC: %06x DE: %06x HL: %06x\n",
g_current_regs[XCPT_BC], g_current_regs[XCPT_DE], g_current_regs[XCPT_HL]);
alert("IX: %06x IY: %06x\n",
g_current_regs[XCPT_IX], g_current_regs[XCPT_IY]);
alert("SP: %06x PC: %06x\n"
g_current_regs[XCPT_SP], g_current_regs[XCPT_PC]);
#endif
}
}

View File

@ -1,7 +1,7 @@
/****************************************************************************
* arch/z80/src/z180/z180_registerdump.c
*
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
* Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -39,17 +39,6 @@
#include <nuttx/config.h>
/* Output debug info -- even if debug is not selected. */
#undef CONFIG_DEBUG_FEATURES
#undef CONFIG_DEBUG_ERROR
#undef CONFIG_DEBUG_WARN
#undef CONFIG_DEBUG_INFO
#define CONFIG_DEBUG_FEATURES 1
#define CONFIG_DEBUG_ERROR 1
#define CONFIG_DEBUG_WARN 1
#define CONFIG_DEBUG_INFO 1
#include <debug.h>
#include <nuttx/irq.h>
@ -72,16 +61,16 @@ static void z180_registerdump(void)
{
if (g_current_regs)
{
llinfo("AF: %04x I: %04x\n",
g_current_regs[XCPT_AF], g_current_regs[XCPT_I]);
llinfo("BC: %04x DE: %04x HL: %04x\n",
g_current_regs[XCPT_BC], g_current_regs[XCPT_DE], g_current_regs[XCPT_HL]);
llinfo("IX: %04x IY: %04x\n",
g_current_regs[XCPT_IX], g_current_regs[XCPT_IY]);
llinfo("SP: %04x PC: %04x\n"
g_current_regs[XCPT_SP], g_current_regs[XCPT_PC]);
llinfo("CBAR: %02x BBR: %02x CBR: %02x\n"
inp(Z180_MMU_CBAR), inp(Z180_MMU_BBR), inp(Z180_MMU_CBR));
alert("AF: %04x I: %04x\n",
g_current_regs[XCPT_AF], g_current_regs[XCPT_I]);
alert("BC: %04x DE: %04x HL: %04x\n",
g_current_regs[XCPT_BC], g_current_regs[XCPT_DE], g_current_regs[XCPT_HL]);
alert("IX: %04x IY: %04x\n",
g_current_regs[XCPT_IX], g_current_regs[XCPT_IY]);
alert("SP: %04x PC: %04x\n"
g_current_regs[XCPT_SP], g_current_regs[XCPT_PC]);
alert("CBAR: %02x BBR: %02x CBR: %02x\n"
inp(Z180_MMU_CBAR), inp(Z180_MMU_BBR), inp(Z180_MMU_CBR));
}
}

View File

@ -1,7 +1,7 @@
/****************************************************************************
* arch/z80/src/z8/z8_registerdump.c
*
* Copyright (C) 2008-2009,2011 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-2009, 2011, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -39,19 +39,6 @@
#include <nuttx/config.h>
/* Output debug info -- even if debug is not selected. */
/* Output debug info -- even if debug is not selected. */
#undef CONFIG_DEBUG_FEATURES
#undef CONFIG_DEBUG_ERROR
#undef CONFIG_DEBUG_WARN
#undef CONFIG_DEBUG_INFO
#define CONFIG_DEBUG_FEATURES 1
#define CONFIG_DEBUG_ERROR 1
#define CONFIG_DEBUG_WARN 1
#define CONFIG_DEBUG_INFO 1
#include <stdint.h>
#include <debug.h>
@ -69,16 +56,16 @@
static inline void z8_dumpregs(FAR chipret_t *regs)
{
llinfo("REGS: %04x %04x %04x %04x %04x %04x %04x %04x\n",
regs[XCPT_RR0], regs[XCPT_RR2], regs[XCPT_RR4], regs[XCPT_RR6],
regs[XCPT_RR8], regs[XCPT_RR10], regs[XCPT_RR12], regs[XCPT_RR14]);
alert("REGS: %04x %04x %04x %04x %04x %04x %04x %04x\n",
regs[XCPT_RR0], regs[XCPT_RR2], regs[XCPT_RR4], regs[XCPT_RR6],
regs[XCPT_RR8], regs[XCPT_RR10], regs[XCPT_RR12], regs[XCPT_RR14]);
}
static inline void z8_dumpstate(chipreg_t sp, chipreg_t pc, uint8_t irqctl,
chipreg_t rpflags)
{
llinfo("SP: %04x PC: %04x IRQCTL: %02x RP: %02x FLAGS: %02x\n",
sp, pc, irqctl & 0xff, rpflags >> 8, rpflags & 0xff);
alert("SP: %04x PC: %04x IRQCTL: %02x RP: %02x FLAGS: %02x\n",
sp, pc, irqctl & 0xff, rpflags >> 8, rpflags & 0xff);
}
/****************************************************************************

View File

@ -39,17 +39,6 @@
#include <nuttx/config.h>
/* Output debug info -- even if debug is not selected. */
#undef CONFIG_DEBUG_FEATURES
#undef CONFIG_DEBUG_ERROR
#undef CONFIG_DEBUG_WARN
#undef CONFIG_DEBUG_INFO
#define CONFIG_DEBUG_FEATURES 1
#define CONFIG_DEBUG_ERROR 1
#define CONFIG_DEBUG_WARN 1
#define CONFIG_DEBUG_INFO 1
#include <debug.h>
#include <nuttx/irq.h>
@ -60,14 +49,6 @@
#ifdef CONFIG_ARCH_STACKDUMP
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
@ -80,14 +61,14 @@ static void z80_registerdump(void)
{
if (g_current_regs)
{
llinfo("AF: %04x I: %04x\n",
g_current_regs[XCPT_AF], g_current_regs[XCPT_I]);
llinfo("BC: %04x DE: %04x HL: %04x\n",
g_current_regs[XCPT_BC], g_current_regs[XCPT_DE], g_current_regs[XCPT_HL]);
llinfo("IX: %04x IY: %04x\n",
g_current_regs[XCPT_IX], g_current_regs[XCPT_IY]);
llinfo("SP: %04x PC: %04x\n"
g_current_regs[XCPT_SP], g_current_regs[XCPT_PC]);
alert("AF: %04x I: %04x\n",
g_current_regs[XCPT_AF], g_current_regs[XCPT_I]);
alert("BC: %04x DE: %04x HL: %04x\n",
g_current_regs[XCPT_BC], g_current_regs[XCPT_DE], g_current_regs[XCPT_HL]);
alert("IX: %04x IY: %04x\n",
g_current_regs[XCPT_IX], g_current_regs[XCPT_IY]);
alert("SP: %04x PC: %04x\n"
g_current_regs[XCPT_SP], g_current_regs[XCPT_PC]);
}
}

View File

@ -105,6 +105,9 @@
* CONFIG_DEBUG_ERROR be defined. This is intended for important error-related
* information that you probably not want to suppress during normal debug
* general debugging.
*
* alert() - is a special, high-priority, unconditional version that is really
* intended only for crash error reporting.
*/
#ifdef CONFIG_HAVE_FUNCTIONNAME
@ -132,6 +135,13 @@
/* C-99 style variadic macros are supported */
#ifdef CONFIG_ARCH_LOWPUTC
# define alert(format, ...) \
__arch_lowsyslog(LOG_EMERG, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
# else
# define alert(x...)
# endif
#ifdef CONFIG_DEBUG_ERROR
# define err(format, ...) \
__arch_syslog(LOG_ERR, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
@ -149,11 +159,11 @@
#ifdef CONFIG_DEBUG_WARN
# define warn(format, ...) \
__arch_syslog(LOG_DEBUG, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
__arch_syslog(LOG_WARNING, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
# ifdef CONFIG_ARCH_LOWPUTC
# define llwarn(format, ...) \
__arch_lowsyslog(LOG_DEBUG, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
__arch_lowsyslog(LOG_WARNING, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
# else
# define llwarn(x...)
# endif
@ -164,11 +174,11 @@
#ifdef CONFIG_DEBUG_INFO
# define info(format, ...) \
__arch_syslog(LOG_DEBUG, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
__arch_syslog(LOG_INFO, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
# ifdef CONFIG_ARCH_LOWPUTC
# define llinfo(format, ...) \
__arch_lowsyslog(LOG_DEBUG, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
__arch_lowsyslog(LOG_INFO, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
# else
# define llinfo(x...)
# endif
@ -543,6 +553,10 @@
/* Variadic macros NOT supported */
#ifndef CONFIG_ARCH_LOWPUTC
# define alert (void)
# endif
#ifdef CONFIG_DEBUG_ERROR
# ifndef CONFIG_ARCH_LOWPUTC
# define llerr (void)
@ -1078,6 +1092,10 @@ void lib_dumpbuffer(FAR const char *msg, FAR const uint8_t *buffer,
*/
#ifndef CONFIG_CPP_HAVE_VARARGS
#ifndef CONFIG_ARCH_LOWPUTC
int alert(const char *format, ...);
#endif
#ifdef CONFIG_DEBUG_ERROR
int err(const char *format, ...);

View File

@ -51,14 +51,28 @@
****************************************************************************/
/****************************************************************************
* Name: err, llerr, info
* Name: alert, err, llerr, warn, llwarn, info, llinfo
*
* Description:
* If the cross-compiler's pre-processor does not support variable
* length arguments, then these additional APIs will be built.
* length arguments, then these additional APIs will be built.
*
****************************************************************************/
#ifdef CONFIG_ARCH_LOWPUTC
int alert(const char *format, ...)
{
va_list ap;
int ret;
va_start(ap, format);
ret = lowvsyslog(LOG_EMERG, format, ap);
va_end(ap);
return ret;
}
#endif /* CONFIG_ARCH_LOWPUTC */
#ifdef CONFIG_DEBUG_FEATURES
int err(const char *format, ...)
{
@ -66,7 +80,7 @@ int err(const char *format, ...)
int ret;
va_start(ap, format);
ret = vsyslog(LOG_DEBUG, format, ap);
ret = vsyslog(LOG_ERR, format, ap);
va_end(ap);
return ret;
@ -107,7 +121,7 @@ int llwarn(const char *format, ...)
int ret;
va_start(ap, format);
ret = lowvsyslog(LOG_DEBUG, format, ap);
ret = lowvsyslog(LOG_WARNING, format, ap);
va_end(ap);
return ret;
@ -122,7 +136,7 @@ int info(const char *format, ...)
int ret;
va_start(ap, format);
ret = vsyslog(LOG_DEBUG, format, ap);
ret = vsyslog(LOG_INFO, format, ap);
va_end(ap);
return ret;
@ -135,7 +149,7 @@ int llinfo(const char *format, ...)
int ret;
va_start(ap, format);
ret = lowvsyslog(LOG_DEBUG, format, ap);
ret = lowvsyslog(LOG_INFO, format, ap);
va_end(ap);
return ret;