From f219a0e3b1ff3eb873cf0b1a32ea601939802ce7 Mon Sep 17 00:00:00 2001 From: lintex9527 Date: Thu, 10 May 2018 10:29:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DKeil5=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E6=89=93=E5=8D=B0=E6=A0=88=E4=BF=A1=E6=81=AF=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 -- cm_backtrace/cm_backtrace.c | 9 +++++---- cm_backtrace/cmb_cfg.h | 1 + demos/os/freertos/stm32f10x/RVMDK/.gitignore | 2 ++ 4 files changed, 8 insertions(+), 6 deletions(-) delete mode 100644 .gitignore diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 379e96b..0000000 --- a/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -JLinkLog.txt -*.dep diff --git a/cm_backtrace/cm_backtrace.c b/cm_backtrace/cm_backtrace.c index f8f0e72..e70d5a3 100644 --- a/cm_backtrace/cm_backtrace.c +++ b/cm_backtrace/cm_backtrace.c @@ -110,7 +110,7 @@ static const char * const print_info[] = { [PRINT_MAIN_STACK_INFO] = "====== Main stack information ======", [PRINT_THREAD_STACK_OVERFLOW] = "Error: Thread stack(%08x) was overflow", [PRINT_MAIN_STACK_OVERFLOW] = "Error: Main stack(%08x) was overflow", - [PRINT_CALL_STACK_INFO] = "Show more call stack info by run: addr2line -e %s%s -a -f %.*s", + [PRINT_CALL_STACK_INFO] = "Show more call stack info by run: addr2line -e %s%s -a -f ", [PRINT_CALL_STACK_ERR] = "Dump call stack has an error", [PRINT_FAULT_ON_THREAD] = "Fault on thread %s", [PRINT_FAULT_ON_HANDLER] = "Fault on interrupt or bare metal(no OS) environment", @@ -148,7 +148,7 @@ static const char * const print_info[] = { [PRINT_MAIN_STACK_INFO] = "============ 主堆栈信息 ============", [PRINT_THREAD_STACK_OVERFLOW] = "错误:线程栈(%08x)发生溢出", [PRINT_MAIN_STACK_OVERFLOW] = "错误:主栈(%08x)发生溢出", - [PRINT_CALL_STACK_INFO] = "查看更多函数调用栈信息,请运行:addr2line -e %s%s -a -f %.*s", + [PRINT_CALL_STACK_INFO] = "查看更多函数调用栈信息,请运行:addr2line -e %s%s -a -f ", [PRINT_CALL_STACK_ERR] = "获取函数调用栈失败", [PRINT_FAULT_ON_THREAD] = "在线程(%s)中发生错误异常", [PRINT_FAULT_ON_HANDLER] = "在中断或裸机环境下发生错误异常", @@ -404,8 +404,9 @@ static void print_call_stack(uint32_t sp) { } if (cur_depth) { - cmb_println(print_info[PRINT_CALL_STACK_INFO], fw_name, CMB_ELF_FILE_EXTENSION_NAME, cur_depth * (8 + 1), - call_stack_info); + // Keil5 may not parse %.*s properly, `call_stack_info` has to be parsed on a new print call. + cmb_print(print_info[PRINT_CALL_STACK_INFO], fw_name, CMB_ELF_FILE_EXTENSION_NAME, cur_depth * (8 + 1)); + cmb_println("%s", call_stack_info); } else { cmb_println(print_info[PRINT_CALL_STACK_ERR]); } diff --git a/cm_backtrace/cmb_cfg.h b/cm_backtrace/cmb_cfg.h index a25d1ca..94431d7 100644 --- a/cm_backtrace/cmb_cfg.h +++ b/cm_backtrace/cmb_cfg.h @@ -30,6 +30,7 @@ #define _CMB_CFG_H_ /* print line, must config by user */ +#define cmb_print(...) /* e.g., printf(__VA_ARGS__); */ #define cmb_println(...) /* e.g., printf(__VA_ARGS__);printf("\r\n") */ /* enable bare metal(no OS) platform */ /* #define CMB_USING_BARE_METAL_PLATFORM */ diff --git a/demos/os/freertos/stm32f10x/RVMDK/.gitignore b/demos/os/freertos/stm32f10x/RVMDK/.gitignore index 655cd52..d1c4e9b 100644 --- a/demos/os/freertos/stm32f10x/RVMDK/.gitignore +++ b/demos/os/freertos/stm32f10x/RVMDK/.gitignore @@ -1,3 +1,5 @@ /Output *.uvgui.* +*.uvopt +*.dep