Lines Matching refs:pc
176 bool Step(uintptr_t& pc, uintptr_t& sp, void *ctx);
177 bool FpStep(uintptr_t& fp, uintptr_t& pc, void *ctx);
188 bool GetFrameByPc(uintptr_t pc, std::shared_ptr<DfxMaps> maps, DfxFrame& frame);
207 uintptr_t pc = 0;
228 void DoPcAdjust(uintptr_t& pc);
379 bool Unwinder::Step(uintptr_t& pc, uintptr_t& sp, void *ctx)
381 return impl_->Step(pc, sp, ctx);
384 bool Unwinder::FpStep(uintptr_t& fp, uintptr_t& pc, void *ctx)
386 return impl_->FpStep(fp, pc, ctx);
419 bool Unwinder::GetFrameByPc(uintptr_t pc, std::shared_ptr<DfxMaps> maps, DfxFrame& frame)
421 return impl_->GetFrameByPc(pc, maps, frame);
671 DFX_TRACE_SCOPED_DLSYM("StepArkJsFrame pc: %p", reinterpret_cast<void *>(frame.pc));
673 timeLimitCheck += "StepArkJsFrame, ark pc: " + std::to_string(frame.pc) +
678 DFXLOGD("+++ark pc: %{public}p, fp: %{public}p, sp: %{public}p, isJsFrame: %{public}d.",
679 reinterpret_cast<void *>(frame.pc),
694 if (DfxArk::GetArkNativeFrameInfo(pid, frame.pc, frame.fp, frame.sp, jsFrames, size) < 0) {
716 ArkUnwindParam arkParam(memory_.get(), &(Unwinder::AccessMem), &frame.fp, &frame.sp, &frame.pc,
720 ret = DfxArk::StepArkFrame(memory_.get(), &(Unwinder::AccessMem), &frame.fp, &frame.sp, &frame.pc,
732 DFXLOGD("---ark pc: %{public}p, fp: %{public}p, sp: %{public}p, isJsFrame: %{public}d.",
733 reinterpret_cast<void *>(frame.pc),
765 frame.pc = regs_->GetPc();
770 regs_->StepIfSignalFrame(static_cast<uintptr_t>(frame.pc), memory_)) {
771 DFXLOGW("Step signal frame, pc: %{public}p", reinterpret_cast<void *>(frame.pc));
777 DoPcAdjust(frame.pc);
781 uintptr_t prevPc = frame.pc;
787 if (frame.pc == prevPc && frame.sp == prevSp) {
790 DFXLOGU("Failed to update pc and sp, tid: %{public}d", uctx->pid);
792 DFXLOGU("Failed to update pc and sp");
794 lastErrorData_.SetAddrAndCode(frame.pc, UNW_ERROR_REPEATED_FRAME);
800 DFXLOGU("Last frame size: %{public}zu, last frame pc: %{public}p",
826 uintptr_t pc = regs_->GetPc();
829 DoPcAdjust(pc);
832 pcs_.emplace_back(pc);
834 if (!FpStep(fp, pc, ctx) || (pc == 0)) {
841 bool Unwinder::Impl::FpStep(uintptr_t& fp, uintptr_t& pc, void *ctx)
844 DFXLOGU("+fp: %{public}lx, pc: %{public}lx", (uint64_t)fp, (uint64_t)pc);
856 memory_->ReadUptr(ptr, &pc, false)) {
859 lastErrorData_.SetAddrAndCode(pc, UNW_ERROR_ILLEGAL_VALUE);
864 regs_->SetPc(StripPac(pc, pacMask_));
865 DFXLOGU("-fp: %{public}lx, pc: %{public}lx", (uint64_t)fp, (uint64_t)pc);
872 bool Unwinder::Impl::Step(uintptr_t& pc, uintptr_t& sp, void *ctx)
874 DFX_TRACE_SCOPED_DLSYM("Step pc:%p", reinterpret_cast<void *>(pc));
881 frame.pc = pc;
885 if (regs_->StepIfSignalFrame(frame.pc, memory_)) {
886 DFXLOGW("Step signal frame, pc: %{public}p", reinterpret_cast<void *>(frame.pc));
891 pc = frame.pc;
903 DFXLOGU("+pc: %{public}p, sp: %{public}p, fp: %{public}p", reinterpret_cast<void *>(frame.pc),
913 auto iter = stepCache_.find(frame.pc);
916 DFXLOGU("Find rs cache, pc: %{public}p", reinterpret_cast<void *>(frame.pc));
927 MAYBE_UNUSED int mapRet = acc_->GetMapByPc(frame.pc, map, ctx);
935 lastErrorData_.SetAddrAndCode(frame.pc, mapRet);
951 DFXLOGE("Failed to step ark Js frame, pc: %{public}p", reinterpret_cast<void *>(frame.pc));
952 lastErrorData_.SetAddrAndCode(frame.pc, UNW_ERROR_STEP_ARK_FRAME);
956 regs_->SetPc(StripPac(frame.pc, pacMask_));
974 MAYBE_UNUSED int utiRet = acc_->FindUnwindTable(frame.pc, uti, ctx);
976 lastErrorData_.SetAddrAndCode(frame.pc, utiRet);
986 if (!armExidx_->SearchEntry(frame.pc, uti, uei)) {
1000 if ((uti.isLinear == false && !dwarfSection_->SearchEntry(frame.pc, uti, uei)) ||
1001 (uti.isLinear == true && !dwarfSection_->LinearSearchEntry(frame.pc, uti, uei))) {
1007 if (!dwarfSection_->Step(frame.pc, (uintptr_t)uei.unwindInfo, rs)) {
1020 stepCache_.emplace(frame.pc, cache);
1053 ret = FpStep(frame.fp, frame.pc, ctx);
1056 DFXLOGI("First enter fp step, pc: %{public}p", reinterpret_cast<void *>(frame.pc));
1063 frame.pc = regs_->GetPc();
1068 lastErrorData_.SetAddrAndCode(frame.pc, UNW_ERROR_ILLEGAL_VALUE);
1071 if (ret && (frame.pc == 0)) {
1074 DFXLOGU("-pc: %{public}p, sp: %{public}p, fp: %{public}p, ret: %{public}d", reinterpret_cast<void *>(frame.pc),
1106 void Unwinder::Impl::DoPcAdjust(uintptr_t& pc)
1108 if (pc <= 0x4) {
1113 if ((pc & 0x1) && (memory_ != nullptr)) {
1115 if (pc < 0x5 || !(memory_->ReadMem(pc - 0x5, &val)) ||
1123 pc -= sz;
1161 pcs_.emplace_back(frame.pc);
1165 dfxFrame.pc = static_cast<uint64_t>(frame.pc);
1219 frame.relPc = frame.pc;
1226 frame.relPc = frame.map->GetRelPc(frame.pc);
1258 if (DfxArk::ParseArkFrameInfoLocal(static_cast<uintptr_t>(frame.pc), static_cast<uintptr_t>(frame.funcOffset),
1260 DFXLOGW("Failed to parse ark frame info local, pc: %{public}p, begin: %{public}p",
1261 reinterpret_cast<void *>(frame.pc), reinterpret_cast<void *>(frame.map->begin));
1266 if (!hap->ParseHapInfo(pid_, frame.pc, static_cast<uintptr_t>(frame.funcOffset), frame.map, &jsFunction)) {
1279 bool Unwinder::Impl::GetFrameByPc(uintptr_t pc, std::shared_ptr<DfxMaps> maps, DfxFrame &frame)
1281 frame.pc = static_cast<uint64_t>(StripPac(pc, 0));
1283 if ((maps == nullptr) || !maps->FindMapByAddr(pc, map) || map == nullptr) {
1331 frame.pc = static_cast<uint64_t>(StripPac(pcs[i], 0));
1332 if ((map != nullptr) && map->Contain(frame.pc)) {
1351 frame.pc = static_cast<uint64_t>(pcs[i]);
1357 bool Unwinder::GetSymbolByPc(uintptr_t pc, std::shared_ptr<DfxMaps> maps, std::string& funcName, uint64_t& funcOffset)
1363 if (!maps->FindMapByAddr(pc, map) || (map == nullptr)) {
1367 uint64_t relPc = map->GetRelPc(static_cast<uint64_t>(pc));
1385 frame->pc = StripPac(frame->pc, 0);
1389 if (frame->pc >= vaddr && frame->pc < vaddr + phdr->p_memsz) {
1390 frame->relPc = frame->pc - info->dlpi_addr;