提交 700c3415 编写于 作者: O openharmony_ci 提交者: Gitee

!435 fix:修复llvm编译环境下内核态内存调测调用栈信息解析有误的问题

Merge pull request !435 from Harylee/mem
...@@ -1215,7 +1215,11 @@ VOID LOS_RecordLR(UINTPTR *LR, UINT32 LRSize, UINT32 recordCount, UINT32 jumpCou ...@@ -1215,7 +1215,11 @@ VOID LOS_RecordLR(UINTPTR *LR, UINT32 LRSize, UINT32 recordCount, UINT32 jumpCou
framePtr = Get_Fp(); framePtr = Get_Fp();
while ((framePtr > stackStart) && (framePtr < stackEnd) && IS_ALIGNED(framePtr, sizeof(CHAR *))) { while ((framePtr > stackStart) && (framePtr < stackEnd) && IS_ALIGNED(framePtr, sizeof(CHAR *))) {
tmpFramePtr = framePtr; tmpFramePtr = framePtr;
#ifdef LOSCFG_COMPILER_CLANG_LLVM
linkReg = *(UINTPTR *)(tmpFramePtr + sizeof(UINTPTR));
#else
linkReg = *(UINTPTR *)framePtr; linkReg = *(UINTPTR *)framePtr;
#endif
if (index >= jumpCount) { if (index >= jumpCount) {
LR[count++] = linkReg; LR[count++] = linkReg;
if (count == recordCount) { if (count == recordCount) {
...@@ -1223,7 +1227,11 @@ VOID LOS_RecordLR(UINTPTR *LR, UINT32 LRSize, UINT32 recordCount, UINT32 jumpCou ...@@ -1223,7 +1227,11 @@ VOID LOS_RecordLR(UINTPTR *LR, UINT32 LRSize, UINT32 recordCount, UINT32 jumpCou
} }
} }
index++; index++;
#ifdef LOSCFG_COMPILER_CLANG_LLVM
framePtr = *(UINTPTR *)framePtr;
#else
framePtr = *(UINTPTR *)(tmpFramePtr - sizeof(UINTPTR)); framePtr = *(UINTPTR *)(tmpFramePtr - sizeof(UINTPTR));
#endif
} }
/* if linkReg is not enough,clean up the last of the effective LR as the end. */ /* if linkReg is not enough,clean up the last of the effective LR as the end. */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册