Lines Matching full:pc
105 void PrintFrame(size_t frame_num, uintptr_t pc, std::ostream &out) in PrintFrame() argument
109 out << "#" << std::setw(2U) << std::left << frame_num << ": 0x" << std::hex << pc << " "; in PrintFrame()
113 VmaEntry *vma = FindVma(pc); in PrintFrame()
117 vma = FindVma(pc); in PrintFrame()
120 uintptr_t pc_offset = pc - vma->start_addr + vma->offset; in PrintFrame()
121 // pc points to the instruction after the call in PrintFrame()
122 // Decrement pc to get source line number pointing to the function call in PrintFrame()
132 if (ReadSymbol(pc, &function, &offset)) { in PrintFrame()
171 bool ReadSymbol(uintptr_t pc, std::string *function, uintptr_t *offset) in ReadSymbol() argument
174 if (dladdr(reinterpret_cast<void *>(pc), &info) != 0 && info.dli_sname != nullptr) { in ReadSymbol()
176 *offset = pc - reinterpret_cast<uintptr_t>(info.dli_saddr); in ReadSymbol()
195 VmaEntry *FindVma(uintptr_t pc) in FindVma() argument
197 VmaEntry el(pc, pc, 0, ""); in FindVma()
200 if (it != vmas_.end() && (it->start_addr <= pc && pc < it->end_addr)) { in FindVma()
264 void Append(uintptr_t pc) in Append() argument
274 buf_[size_++] = pc; // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic) in Append()
292 uintptr_t pc = _Unwind_GetIP(ctx); in FrameHandler() local
293 // _Unwind_GetIP returns 0 pc at the end of the stack. Ignore it in FrameHandler()
294 if (pc != 0) { in FrameHandler()
295 buf->Append(pc); in FrameHandler()