1
0
mirror of https://github.com/armink/CmBacktrace.git synced 2025-01-25 00:22:53 +08:00

1、【修改】废弃的 __get_SP 为 cmb_get_sp 。

Signed-off-by: armink <armink.ztl@gmail.com>
This commit is contained in:
armink 2017-11-04 22:24:27 +08:00
parent 9bdabf06cd
commit 8363ccb913
2 changed files with 2 additions and 2 deletions

View File

@ -125,7 +125,7 @@ size_t cm_backtrace_call_stack(uint32_t *buffer, size_t size, uint32_t sp)
uint32_t call_stack[16] = {0};
size_t i, depth = 0;
/* 获取当前环境下的函数调用栈,每个元素将会以 32 位地址形式存储, depth 为函数调用栈实际深度 */
depth = cm_backtrace_call_stack(call_stack, sizeof(call_stack), __get_SP());
depth = cm_backtrace_call_stack(call_stack, sizeof(call_stack), cmb_get_sp());
/* 输出当前函数调用栈信息
* 注意:查看函数名称及具体行号时,需要使用 addr2line 工具转换
*/

View File

@ -67,7 +67,7 @@ static rt_err_t exception_hook(void *context) {
list_thread();
#endif
cm_backtrace_fault(*((uint32_t *)(__get_SP() + sizeof(uint32_t) * 8)), __get_SP() + sizeof(uint32_t) * 9);
cm_backtrace_fault(*((uint32_t *)(cmb_get_sp() + sizeof(uint32_t) * 8)), cmb_get_sp() + sizeof(uint32_t) * 9);
while (_continue == 1);