mirror of
https://github.com/apache/nuttx.git
synced 2026-05-23 06:39:01 +08:00
assert: add more information to panic notifier
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
This commit is contained in:
@@ -46,8 +46,11 @@ enum panic_type_e
|
||||
|
||||
struct panic_notifier_s
|
||||
{
|
||||
FAR struct tcb_s *rtcb;
|
||||
FAR void *regs;
|
||||
FAR struct tcb_s *rtcb;
|
||||
FAR void *regs;
|
||||
FAR const char *msg;
|
||||
FAR const char *filename;
|
||||
int linenum;
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
+7
-4
@@ -570,10 +570,6 @@ void _assert(FAR const char *filename, int linenum,
|
||||
regs = g_last_regs;
|
||||
}
|
||||
|
||||
/* Flush any buffered SYSLOG data (from prior to the assertion) */
|
||||
|
||||
syslog_flush();
|
||||
|
||||
#if CONFIG_BOARD_RESET_ON_ASSERT < 2
|
||||
if (!up_interrupt_context() &&
|
||||
(rtcb->flags & TCB_FLAG_TTYPE_MASK) != TCB_FLAG_TTYPE_KERNEL)
|
||||
@@ -584,9 +580,16 @@ void _assert(FAR const char *filename, int linenum,
|
||||
|
||||
notifier_data.rtcb = rtcb;
|
||||
notifier_data.regs = regs;
|
||||
notifier_data.filename = filename;
|
||||
notifier_data.linenum = linenum;
|
||||
notifier_data.msg = msg;
|
||||
panic_notifier_call_chain(fatal ? PANIC_KERNEL : PANIC_TASK,
|
||||
¬ifier_data);
|
||||
|
||||
/* Flush any buffered SYSLOG data (from prior to the assertion) */
|
||||
|
||||
syslog_flush();
|
||||
|
||||
uname(&name);
|
||||
_alert("Current Version: %s %s %s %s %s\n",
|
||||
name.sysname, name.nodename,
|
||||
|
||||
Reference in New Issue
Block a user