mirror of
https://github.com/apache/nuttx.git
synced 2026-05-29 04:19:37 +08:00
arch/assert: flush the syslog before stack dump
flush the syslog before stack dump to avoid buffer overwrite Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
|
||||
#include <nuttx/irq.h>
|
||||
#include <nuttx/arch.h>
|
||||
#include <nuttx/syslog/syslog.h>
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include "sched/sched.h"
|
||||
@@ -50,6 +51,10 @@ static void up_stackdump(uint32_t sp, uint32_t stack_top)
|
||||
{
|
||||
uint32_t stack;
|
||||
|
||||
/* Flush any buffered SYSLOG data to avoid overwrite */
|
||||
|
||||
syslog_flush();
|
||||
|
||||
for (stack = sp & ~0x1f; stack < (stack_top & ~0x1f); stack += 32)
|
||||
{
|
||||
uint32_t *ptr = (uint32_t *)stack;
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
|
||||
#include <nuttx/irq.h>
|
||||
#include <nuttx/arch.h>
|
||||
#include <nuttx/syslog/syslog.h>
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include "sched/sched.h"
|
||||
@@ -50,6 +51,10 @@ static void up_stackdump(uint32_t sp, uint32_t stack_top)
|
||||
{
|
||||
uint32_t stack;
|
||||
|
||||
/* Flush any buffered SYSLOG data to avoid overwrite */
|
||||
|
||||
syslog_flush();
|
||||
|
||||
for (stack = sp & ~0x1f; stack < (stack_top & ~0x1f); stack += 32)
|
||||
{
|
||||
uint32_t *ptr = (uint32_t *) stack;
|
||||
|
||||
Reference in New Issue
Block a user