[Desc] Solve the problem of exception stack traceback for clang.

Change-Id: Ifdca9a23ba788fa66f3815203514c9034680df49
This commit is contained in:
YOUR_NAME 2021-04-07 15:43:57 +08:00
parent a2e59ba316
commit 03a64228ed
1 changed files with 9 additions and 0 deletions

View File

@ -688,12 +688,21 @@ VOID BackTraceSub(UINTPTR regFP)
while (IsValidFP(backFP, stackStart, stackEnd, &kvaddr) == TRUE) {
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;
#else
backLR = *(UINTPTR *)(UINTPTR)kvaddr;
if (IsValidFP(tmpFP - POINTER_SIZE, stackStart, stackEnd, &kvaddr) == FALSE) {
PrintExcInfo("traceback backFP check failed, backFP: 0x%x\n", tmpFP - POINTER_SIZE);
return;
}
backFP = *(UINTPTR *)(UINTPTR)kvaddr;
#endif
#ifdef LOSCFG_KERNEL_VM
LosVmMapRegion *region = NULL;
if (LOS_IsUserAddress((VADDR_T)backLR) == TRUE) {