提交 06576f4c 编写于 作者: O openharmony_ci 提交者: Gitee

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

Merge pull request !180 from zhangfanfan2/master
...@@ -663,6 +663,7 @@ VOID BackTraceSub(UINTPTR regFP) ...@@ -663,6 +663,7 @@ VOID BackTraceSub(UINTPTR regFP)
UINTPTR backFP = regFP; UINTPTR backFP = regFP;
UINT32 count = 0; UINT32 count = 0;
VADDR_T kvaddr; VADDR_T kvaddr;
LosProcessCB *runProcess = OsCurrProcessGet();
if (FindSuitableStack(regFP, &stackStart, &stackEnd, &kvaddr) == FALSE) { if (FindSuitableStack(regFP, &stackStart, &stackEnd, &kvaddr) == FALSE) {
PrintExcInfo("traceback error fp = 0x%x\n", regFP); PrintExcInfo("traceback error fp = 0x%x\n", regFP);
...@@ -701,11 +702,12 @@ VOID BackTraceSub(UINTPTR regFP) ...@@ -701,11 +702,12 @@ VOID BackTraceSub(UINTPTR regFP)
#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) {
region = LOS_RegionFind(OsCurrProcessGet()->vmSpace, (VADDR_T)backLR); region = LOS_RegionFind(runProcess->vmSpace, (VADDR_T)backLR);
} }
if (region != NULL) { if (region != NULL) {
PrintExcInfo("traceback %u -- lr = 0x%x fp = 0x%x lr in %s --> 0x%x\n", count, backLR, backFP, 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; region = NULL;
} else } else
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册