[Desc] Solve the problem of exception stack traceback for clang.
Change-Id: Ifdca9a23ba788fa66f3815203514c9034680df49
This commit is contained in:
parent
a2e59ba316
commit
03a64228ed
|
@ -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) {
|
||||||
|
|
Loading…
Reference in New Issue