AVR assertion logic will report stack usage on crash if DEBUG_STACK is set
This commit is contained in:
parent
b1c17e82ba
commit
3ca1585c4f
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/avr/src/avr/up_dumpstate.c
|
* arch/avr/src/avr/up_dumpstate.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2011, 2014 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -58,6 +58,12 @@
|
|||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
/* Check if we can dump stack usage information */
|
||||||
|
|
||||||
|
#ifndef CONFIG_DEBUG
|
||||||
|
# undef CONFIG_DEBUG_STACK
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Output debug info if stack dump is selected -- even if debug is not
|
/* Output debug info if stack dump is selected -- even if debug is not
|
||||||
* selected.
|
* selected.
|
||||||
*/
|
*/
|
||||||
@ -202,6 +208,9 @@ void up_dumpstate(void)
|
|||||||
lldbg("IRQ stack:\n");
|
lldbg("IRQ stack:\n");
|
||||||
lldbg(" base: %04x\n", istackbase);
|
lldbg(" base: %04x\n", istackbase);
|
||||||
lldbg(" size: %04x\n", istacksize);
|
lldbg(" size: %04x\n", istacksize);
|
||||||
|
#ifdef CONFIG_DEBUG_STACK
|
||||||
|
lldbg(" used: %08x\n", up_check_intstack());
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Does the current stack pointer lie within the interrupt
|
/* Does the current stack pointer lie within the interrupt
|
||||||
* stack?
|
* stack?
|
||||||
@ -228,6 +237,9 @@ void up_dumpstate(void)
|
|||||||
lldbg("User stack:\n");
|
lldbg("User stack:\n");
|
||||||
lldbg(" base: %04x\n", ustackbase);
|
lldbg(" base: %04x\n", ustackbase);
|
||||||
lldbg(" size: %04x\n", ustacksize);
|
lldbg(" size: %04x\n", ustacksize);
|
||||||
|
#ifdef CONFIG_DEBUG_STACK
|
||||||
|
lldbg(" used: %08x\n", up_check_tcbstack(rtcb));
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Dump the user stack if the stack pointer lies within the allocated user
|
/* Dump the user stack if the stack pointer lies within the allocated user
|
||||||
* stack memory.
|
* stack memory.
|
||||||
@ -241,6 +253,9 @@ void up_dumpstate(void)
|
|||||||
lldbg("sp: %04x\n", sp);
|
lldbg("sp: %04x\n", sp);
|
||||||
lldbg("stack base: %04x\n", ustackbase);
|
lldbg("stack base: %04x\n", ustackbase);
|
||||||
lldbg("stack size: %04x\n", ustacksize);
|
lldbg("stack size: %04x\n", ustacksize);
|
||||||
|
#ifdef CONFIG_DEBUG_STACK
|
||||||
|
lldbg("stack used: %08x\n", up_check_tcbstack(rtcb));
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Dump the user stack if the stack pointer lies within the allocated user
|
/* Dump the user stack if the stack pointer lies within the allocated user
|
||||||
* stack memory.
|
* stack memory.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/avr/src/avr32/up_dumpstate.c
|
* arch/avr/src/avr32/up_dumpstate.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2010-2011 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2010-2011, 2014 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -58,6 +58,12 @@
|
|||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
/* Check if we can dump stack usage information */
|
||||||
|
|
||||||
|
#ifndef CONFIG_DEBUG
|
||||||
|
# undef CONFIG_DEBUG_STACK
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Output debug info if stack dump is selected -- even if debug is not
|
/* Output debug info if stack dump is selected -- even if debug is not
|
||||||
* selected.
|
* selected.
|
||||||
*/
|
*/
|
||||||
@ -179,6 +185,9 @@ void up_dumpstate(void)
|
|||||||
lldbg("IRQ stack:\n");
|
lldbg("IRQ stack:\n");
|
||||||
lldbg(" base: %08x\n", istackbase);
|
lldbg(" base: %08x\n", istackbase);
|
||||||
lldbg(" size: %08x\n", istacksize);
|
lldbg(" size: %08x\n", istacksize);
|
||||||
|
#ifdef CONFIG_DEBUG_STACK
|
||||||
|
lldbg(" used: %08x\n", up_check_intstack());
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Does the current stack pointer lie within the interrupt
|
/* Does the current stack pointer lie within the interrupt
|
||||||
* stack?
|
* stack?
|
||||||
@ -205,6 +214,9 @@ void up_dumpstate(void)
|
|||||||
lldbg("User stack:\n");
|
lldbg("User stack:\n");
|
||||||
lldbg(" base: %08x\n", ustackbase);
|
lldbg(" base: %08x\n", ustackbase);
|
||||||
lldbg(" size: %08x\n", ustacksize);
|
lldbg(" size: %08x\n", ustacksize);
|
||||||
|
#ifdef CONFIG_DEBUG_STACK
|
||||||
|
lldbg(" used: %08x\n", up_check_tcbstack(rtcb));
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Dump the user stack if the stack pointer lies within the allocated user
|
/* Dump the user stack if the stack pointer lies within the allocated user
|
||||||
* stack memory.
|
* stack memory.
|
||||||
@ -218,6 +230,9 @@ void up_dumpstate(void)
|
|||||||
lldbg("sp: %08x\n", sp);
|
lldbg("sp: %08x\n", sp);
|
||||||
lldbg("stack base: %08x\n", ustackbase);
|
lldbg("stack base: %08x\n", ustackbase);
|
||||||
lldbg("stack size: %08x\n", ustacksize);
|
lldbg("stack size: %08x\n", ustacksize);
|
||||||
|
#ifdef CONFIG_DEBUG_STACK
|
||||||
|
lldbg("stack used: %08x\n", up_check_tcbstack(rtcb));
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Dump the user stack if the stack pointer lies within the allocated user
|
/* Dump the user stack if the stack pointer lies within the allocated user
|
||||||
* stack memory.
|
* stack memory.
|
||||||
|
Loading…
Reference in New Issue
Block a user