提交 cf5baa29 编写于 作者: O openharmony_ci 提交者: Gitee

!127 clang编译的系统镜像内核栈回溯功能失效

Merge pull request !127 from zhangfanfan2/master
...@@ -688,12 +688,21 @@ VOID BackTraceSub(UINTPTR regFP) ...@@ -688,12 +688,21 @@ VOID BackTraceSub(UINTPTR regFP)
while (IsValidFP(backFP, stackStart, stackEnd, &kvaddr) == TRUE) { while (IsValidFP(backFP, stackStart, stackEnd, &kvaddr) == TRUE) {
tmpFP = backFP; tmpFP = backFP;
#ifdef LOSCFG_COMPILER_CLANG_LLVM
backFP = *(UINTPTR *)(UINTPTR)kvaddr;
if (IsValidFP(tmpFP + POINTER_SIZE, stackStart, stackEnd, &kvaddr) == FALSE) {
PrintExcInfo("traceback backLR check failed, backLP: 0x%x\n", tmpFP + POINTER_SIZE);
return;
}
backLR = *(UINTPTR *)(UINTPTR)kvaddr; backLR = *(UINTPTR *)(UINTPTR)kvaddr;
#else
backLR = *(UINTPTR *)(UINTPTR)kvaddr;
if (IsValidFP(tmpFP - POINTER_SIZE, stackStart, stackEnd, &kvaddr) == FALSE) { if (IsValidFP(tmpFP - POINTER_SIZE, stackStart, stackEnd, &kvaddr) == FALSE) {
PrintExcInfo("traceback backFP check failed, backFP: 0x%x\n", tmpFP - POINTER_SIZE); PrintExcInfo("traceback backFP check failed, backFP: 0x%x\n", tmpFP - POINTER_SIZE);
return; return;
} }
backFP = *(UINTPTR *)(UINTPTR)kvaddr; backFP = *(UINTPTR *)(UINTPTR)kvaddr;
#endif
#ifdef LOSCFG_KERNEL_VM #ifdef LOSCFG_KERNEL_VM
LosVmMapRegion *region = NULL; LosVmMapRegion *region = NULL;
if (LOS_IsUserAddress((VADDR_T)backLR) == TRUE) { if (LOS_IsUserAddress((VADDR_T)backLR) == TRUE) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册