Add support for dumping board-specific information on assertion. From David Sidrane
This commit is contained in:
parent
466b69fe00
commit
a5043d5e60
@ -352,6 +352,12 @@ void up_assert(const uint8_t *filename, int lineno)
|
||||
lldbg("Assertion failed at file:%s line: %d\n",
|
||||
filename, lineno);
|
||||
#endif
|
||||
|
||||
up_dumpstate();
|
||||
|
||||
#ifdef CONFIG_BOARD_CRASHDUMP
|
||||
board_crashdump(up_getsp(), g_readytorun.head, filename, lineno);
|
||||
#endif
|
||||
|
||||
_up_assert(EXIT_FAILURE);
|
||||
}
|
||||
|
@ -369,5 +369,10 @@ void up_assert(const uint8_t *filename, int lineno)
|
||||
#endif
|
||||
|
||||
up_dumpstate();
|
||||
|
||||
#ifdef CONFIG_BOARD_CRASHDUMP
|
||||
board_crashdump(up_getsp(), g_readytorun.head, filename, lineno);
|
||||
#endif
|
||||
|
||||
_up_assert(EXIT_FAILURE);
|
||||
}
|
||||
|
@ -367,5 +367,10 @@ void up_assert(const uint8_t *filename, int lineno)
|
||||
filename, lineno);
|
||||
#endif
|
||||
up_dumpstate();
|
||||
|
||||
#ifdef CONFIG_BOARD_CRASHDUMP
|
||||
board_crashdump(up_getsp(), g_readytorun.head, filename, lineno);
|
||||
#endif
|
||||
|
||||
_up_assert(EXIT_FAILURE);
|
||||
}
|
||||
|
@ -378,5 +378,10 @@ void up_assert(const uint8_t *filename, int lineno)
|
||||
#endif
|
||||
|
||||
up_dumpstate();
|
||||
|
||||
#ifdef CONFIG_BOARD_CRASHDUMP
|
||||
board_crashdump(up_getsp(), g_readytorun.head, filename, lineno);
|
||||
#endif
|
||||
|
||||
_up_assert(EXIT_FAILURE);
|
||||
}
|
||||
|
@ -46,6 +46,7 @@
|
||||
|
||||
#include <nuttx/kmalloc.h>
|
||||
#include <nuttx/arch.h>
|
||||
#include <nuttx/board.h>
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include "up_arch.h"
|
||||
|
@ -175,6 +175,10 @@ void up_assert(const uint8_t *filename, int lineno)
|
||||
|
||||
up_dumpstate();
|
||||
|
||||
#ifdef CONFIG_BOARD_CRASHDUMP
|
||||
board_crashdump(up_getsp(), g_readytorun.head, filename, lineno);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ARCH_USBDUMP
|
||||
/* Dump USB trace data */
|
||||
|
||||
|
@ -337,5 +337,10 @@ void up_assert(const uint8_t *filename, int lineno)
|
||||
#endif
|
||||
|
||||
up_dumpstate();
|
||||
|
||||
#ifdef CONFIG_BOARD_CRASHDUMP
|
||||
board_crashdump(up_getsp(), g_readytorun.head, filename, lineno);
|
||||
#endif
|
||||
|
||||
_up_assert(EXIT_FAILURE);
|
||||
}
|
||||
|
@ -181,5 +181,9 @@ void up_assert(const uint8_t *filename, int lineno)
|
||||
(void)usbtrace_enumerate(assert_tracecallback, NULL);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BOARD_CRASHDUMP
|
||||
board_crashdump(up_getsp(), g_readytorun.head, filename, lineno);
|
||||
#endif
|
||||
|
||||
_up_assert(EXIT_FAILURE);
|
||||
}
|
||||
|
@ -487,6 +487,10 @@ void up_assert(const uint8_t *filename, int line)
|
||||
{
|
||||
fprintf(stderr, "Assertion failed at file:%s line: %d\n", filename, line);
|
||||
|
||||
#ifdef CONFIG_BOARD_CRASHDUMP
|
||||
board_crashdump(up_getsp(), g_readytorun.head, filename, line);
|
||||
#endif
|
||||
|
||||
// in interrupt context or idle task means kernel error
|
||||
// which will stop the OS
|
||||
// if in user space just terminate the task
|
||||
|
@ -169,5 +169,9 @@ void up_assert(const uint8_t *filename, int lineno)
|
||||
(void)usbtrace_enumerate(assert_tracecallback, NULL);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BOARD_CRASHDUMP
|
||||
board_crashdump(up_getsp(), g_readytorun.head, filename, lineno);
|
||||
#endif
|
||||
|
||||
_up_assert(EXIT_FAILURE);
|
||||
}
|
||||
|
@ -81,5 +81,10 @@ int main(int argc, char **argv, char **envp)
|
||||
void up_assert(const uint8_t *filename, int line)
|
||||
{
|
||||
fprintf(stderr, "Assertion failed at file:%s line: %d\n", filename, line);
|
||||
|
||||
#ifdef CONFIG_BOARD_CRASHDUMP
|
||||
board_crashdump(up_getsp(), g_readytorun.head, filename, line);
|
||||
#endif
|
||||
|
||||
longjmp(sim_abort, 1);
|
||||
}
|
||||
|
@ -299,5 +299,10 @@ void up_assert(const uint8_t *filename, int lineno)
|
||||
#endif
|
||||
|
||||
up_dumpstate();
|
||||
|
||||
#ifdef CONFIG_BOARD_CRASHDUMP
|
||||
board_crashdump(up_getsp(), g_readytorun.head, filename, lineno);
|
||||
#endif
|
||||
|
||||
_up_assert(EXIT_FAILURE);
|
||||
}
|
||||
|
@ -181,5 +181,9 @@ void up_assert(void)
|
||||
(void)usbtrace_enumerate(assert_tracecallback, NULL);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BOARD_CRASHDUMP
|
||||
board_crashdump(up_getsp(), g_readytorun.head, filename, lineno);
|
||||
#endif
|
||||
|
||||
_up_assert(EXIT_FAILURE);
|
||||
}
|
||||
|
@ -180,5 +180,9 @@ void up_assert(void)
|
||||
(void)usbtrace_enumerate(assert_tracecallback, NULL);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BOARD_CRASHDUMP
|
||||
board_crashdump(up_getsp(), g_readytorun.head, filename, lineno);
|
||||
#endif
|
||||
|
||||
_up_assert(EXIT_FAILURE);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user