Home | History | Annotate | Download | only in debug

Lines Matching refs:fp

49 uintptr_t GetNextStackFrame(uintptr_t fp) {
50 return reinterpret_cast<const uintptr_t*>(fp)[0] - kStackFrameAdjustment;
53 uintptr_t GetStackFramePC(uintptr_t fp) {
54 return reinterpret_cast<const uintptr_t*>(fp)[1];
57 bool IsStackFrameValid(uintptr_t fp, uintptr_t prev_fp, uintptr_t stack_end) {
60 if (fp <= prev_fp) return false;
63 if (fp - prev_fp > 100000) return false;
66 if (fp & (sizeof(uintptr_t) - 1)) return false;
69 // Both fp[0] and fp[1] must be within the stack.
70 if (fp > stack_end - 2 * sizeof(uintptr_t)) return false;
73 if (GetStackFramePC(fp) < 32768) return false;
103 uintptr_t ScanStackForNextFrame(uintptr_t fp, uintptr_t stack_end) {
113 fp += sizeof(uintptr_t); // current frame is known to be invalid
114 uintptr_t last_fp_to_scan = std::min(fp + kMaxStackScanArea, stack_end) -
116 for (;fp <= last_fp_to_scan; fp += sizeof(uintptr_t)) {
117 uintptr_t next_fp = GetNextStackFrame(fp);
118 if (IsStackFrameValid(next_fp, fp, stack_end)) {
125 return fp;
134 // Links stack frame |fp| to |parent_fp|, so that during stack unwinding
135 // TraceStackFramePointers() visits |parent_fp| after visiting |fp|.
137 // Returns previous stack frame |fp| was linked to.
139 uintptr_t fp = reinterpret_cast<uintptr_t>(fpp) - kStackFrameAdjustment;
140 void* prev_parent_fp = reinterpret_cast<void**>(fp)[0];
141 reinterpret_cast<void**>(fp)[0] = parent_fp;
241 // function even if they are not enabled globally. So 'fp' will always
243 uintptr_t fp = reinterpret_cast<uintptr_t>(__builtin_frame_address(0)) -
253 out_trace[depth++] = reinterpret_cast<const void*>(GetStackFramePC(fp));
256 uintptr_t next_fp = GetNextStackFrame(fp);
257 if (IsStackFrameValid(next_fp, fp, stack_end)) {
258 fp = next_fp;
262 next_fp = ScanStackForNextFrame(fp, stack_end);
264 fp = next_fp;
277 ScopedStackFrameLinker::ScopedStackFrameLinker(void* fp, void* parent_fp)
278 : fp_(fp),
280 original_parent_fp_(LinkStackFrames(fp, parent_fp)) {}