summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorHanhui <sylixos@gmail.com>2019-05-13 13:20:52 (GMT)
committer Hanhui <sylixos@gmail.com>2019-04-18 15:50:22 (GMT)
commita1eb6418d5e40f0356852c1a3b02c80cec786863 (patch)
tree490a4d036429066702133f780ea8312a0261bf30
parente89da1b7d67a595096a416744fad0b40a76083bb (diff)
downloadAIC-OS-a1eb6418d5e40f0356852c1a3b02c80cec786863.zip
Process run-time environment dlmalloc ABORT print backtrace.
-rw-r--r--SylixOS/vpmpdm/dlmalloc/dl_malloc.c10
-rw-r--r--SylixOS/vpmpdm/dlmalloc/dlmalloc.h4
-rw-r--r--SylixOS/vpmpdm/vpmpdm.c2
3 files changed, 15 insertions, 1 deletions
diff --git a/SylixOS/vpmpdm/dlmalloc/dl_malloc.c b/SylixOS/vpmpdm/dlmalloc/dl_malloc.c
index a8fbb9e..696f8ed 100644
--- a/SylixOS/vpmpdm/dlmalloc/dl_malloc.c
+++ b/SylixOS/vpmpdm/dlmalloc/dl_malloc.c
@@ -112,5 +112,15 @@ void *dlmalloc_mremap (void *pvAddr, size_t stOldSize, size_t stNewSize, int mv
}
/*
+ * dlmalloc_abort
+ */
+void dlmalloc_abort (void)
+{
+ fprintf(stderr, "dlmalloc abort!\n");
+ API_BacktraceShow(STD_ERR, 100);
+ lib_abort();
+}
+
+/*
* end
*/
diff --git a/SylixOS/vpmpdm/dlmalloc/dlmalloc.h b/SylixOS/vpmpdm/dlmalloc/dlmalloc.h
index 2b34896..cdf29d4 100644
--- a/SylixOS/vpmpdm/dlmalloc/dlmalloc.h
+++ b/SylixOS/vpmpdm/dlmalloc/dlmalloc.h
@@ -36,6 +36,7 @@
void *dlmalloc_sbrk(int size);
void *dlmalloc_mmap(size_t stLen);
void *dlmalloc_mremap(void *pvAddr, size_t stOldSize, size_t stNewSize, int mv);
+void dlmalloc_abort(void);
/* use dl prefix */
#define USE_DL_PREFIX 1
@@ -61,6 +62,9 @@ void *dlmalloc_mremap(void *pvAddr, size_t stOldSize, size_t stNewSize, int mv);
#define DEFAULT_MMAP_THRESHOLD (256 * 1024) /* 256K */
#endif /* LW_CFG_VMM_EN > 0 */
+/* Abort */
+#define ABORT dlmalloc_abort()
+
/* Use some mutex locks */
#define USE_LOCKS 1
#define USE_SPIN_LOCKS 0
diff --git a/SylixOS/vpmpdm/vpmpdm.c b/SylixOS/vpmpdm/vpmpdm.c
index 33993da..17fb530 100644
--- a/SylixOS/vpmpdm/vpmpdm.c
+++ b/SylixOS/vpmpdm/vpmpdm.c
@@ -58,7 +58,7 @@
#include "./loader/include/loader_lib.h" /* need __eabi */
#endif /* LW_CFG_CPU_ARCH_PPC */
-#define __VP_PATCH_VERSION "2.1.3" /* vp patch version */
+#define __VP_PATCH_VERSION "2.1.4" /* vp patch version */
/*
* fixed gcc old version.