assert: Distinguish between assert and exception

CURRENT_REGS may change during assert handling, so pass
in the 'regs' parameter at the entry point of _assert.

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
This commit is contained in:
zhangyuan21
2023-04-10 21:19:12 +08:00
committed by Xiang Xiao
parent 5a1efdecfd
commit 884be2bdb9
35 changed files with 57 additions and 50 deletions
+3 -1
View File
@@ -48,6 +48,7 @@
#endif
#define PANIC() __assert(__FILE__, __LINE__, "panic")
#define PANIC_WITH_REGS(msg, regs) _assert(__FILE__, __LINE__, msg, regs)
#ifdef CONFIG_DEBUG_ASSERTIONS_EXPRESSION
# define ASSERT(f) \
@@ -152,7 +153,8 @@ extern "C"
*
****************************************************************************/
void _assert(FAR const char *filename, int linenum, FAR const char *msg);
void _assert(FAR const char *filename, int linenum,
FAR const char *msg, FAR void *regs);
/****************************************************************************
* Name: __assert
+1 -1
View File
@@ -25,7 +25,7 @@
*/
SYSCALL_LOOKUP1(_exit, 1)
SYSCALL_LOOKUP(_assert, 3)
SYSCALL_LOOKUP(_assert, 4)
SYSCALL_LOOKUP(getpid, 0)
SYSCALL_LOOKUP(gettid, 0)
SYSCALL_LOOKUP(prctl, 2)