!180 用户态异常栈回溯过程LR解析的值不正确

Merge pull request !180 from zhangfanfan2/master
This commit is contained in:
openharmony_ci 2021-04-23 15:17:41 +08:00 committed by Gitee
commit 06576f4c07
1 changed files with 4 additions and 2 deletions

View File

@ -663,6 +663,7 @@ VOID BackTraceSub(UINTPTR regFP)
UINTPTR backFP = regFP;
UINT32 count = 0;
VADDR_T kvaddr;
LosProcessCB *runProcess = OsCurrProcessGet();
if (FindSuitableStack(regFP, &stackStart, &stackEnd, &kvaddr) == FALSE) {
PrintExcInfo("traceback error fp = 0x%x\n", regFP);
@ -701,11 +702,12 @@ VOID BackTraceSub(UINTPTR regFP)
#ifdef LOSCFG_KERNEL_VM
LosVmMapRegion *region = NULL;
if (LOS_IsUserAddress((VADDR_T)backLR) == TRUE) {
region = LOS_RegionFind(OsCurrProcessGet()->vmSpace, (VADDR_T)backLR);
region = LOS_RegionFind(runProcess->vmSpace, (VADDR_T)backLR);
}
if (region != NULL) {
PrintExcInfo("traceback %u -- lr = 0x%x fp = 0x%x lr in %s --> 0x%x\n", count, backLR, backFP,
OsGetRegionNameOrFilePath(region), backLR - region->range.base);
OsGetRegionNameOrFilePath(region),
backLR - OsGetTextRegionBase(region, runProcess));
region = NULL;
} else
#endif