36#ifndef ASSERT_INFO_H_INCLUDED
37#define ASSERT_INFO_H_INCLUDED
52#if (defined(__TARGET_FPU_VFP) || defined(__ARMVFP__))
63#include "memutils/common_utils/common_types.h"
67#define DBG_P(...) printf("Assertion information: " __VA_ARGS__)
76#ifndef DMP_ASSERT_INFO_NUM
77#define DMP_ASSERT_INFO_SEQ_LOG(p)
84 AssertIdException = 1,
85 AssertIdOsIllegal = 2,
86 AssertIdOsStackIllegal = 3,
89 AssertIdTypeUnmatch = 6,
90 AssertIdSizeError = 7,
91 AssertIdBadMsgQueState = 8,
92 AssertIdMemSegLeak = 9,
102 uint16_t m_body_size;
108 m_body_size(log_size -
sizeof(*
this)) {}
117 char m_filename[128];
122 m_ret_addr(
reinterpret_cast<uint32_t
>(ret_addr)),
125 size_t n = strlen(filename);
126 if (n <
sizeof(m_filename)) {
127 strcpy(m_filename, filename);
129 strcpy(m_filename, filename + n -
sizeof(m_filename) + 1);
131 DBG_P(
"TaskID=%d, file=%s, line=%ld, return addr=%08lx\n", m_task_id, m_filename, m_line, m_ret_addr);
132 DMP_ASSERT_INFO_SEQ_LOG(*
this);
137const uint32_t RegSaveSize = SAVESZ;
140const uint32_t RegSaveSize = 284;
142const uint32_t RegSaveSize = 140;
153 uint32_t m_bad_vaddr;
156 uint8_t m_kStk[RegSaveSize];
159 const uint32_t* uStk = NULL,
const uint32_t* kStk = NULL) :
164 m_bad_vaddr(bad_vaddr),
165 m_user_sp(
reinterpret_cast<uint32_t
>(uStk))
168 memcpy(m_uStk, uStk,
sizeof(m_uStk));
174 m_body_size -=
sizeof(m_uStk);
177 memcpy(m_kStk, kStk,
sizeof(m_kStk));
179 m_body_size -=
sizeof(m_kStk);
181 DBG_P(
"TaskID=%d, Cause=%08lx, EPC=%08lx, SR=%08lx\n", m_task_id, m_cause, m_epc, m_sr);
182 DMP_ASSERT_INFO_SEQ_LOG(*
this);
199 for (
size_t i = 0; i < COUNT_OF(m_data); i++) {
202 DBG_P(
"BadAddr=%p, Data=%08lx, %08lx, %08lx, %08lx\n", m_addr, m_data[0], m_data[1], m_data[2], m_data[3]);
203 DMP_ASSERT_INFO_SEQ_LOG(*
this);
213 AssertParamLog(AssertLogId
id, uint32_t p0, uint32_t p1 = 0, uint32_t p2 = 0, uint32_t p3 = 0) :
216 m_param[0] = p0; m_param[1] = p1; m_param[2] = p2; m_param[3] = p3;
217 DBG_P(
"TaskID=%d, AssertID=%u, param=%08lx, %08lx, %08lx, %08lx\n", m_task_id,
id, p0, p1, p2, p3);
218 DMP_ASSERT_INFO_SEQ_LOG(*
this);
Definition: AssertInfo.h:149
Definition: AssertInfo.h:189
Definition: AssertInfo.h:99
Definition: AssertInfo.h:114
Definition: AssertInfo.h:210