Home | History | Annotate | Download | only in runtime

Lines Matching refs:frame

16 // incoming value of LR at the bottom of the newly allocated stack frame.
18 // the call instruction, so the return PC ends up above the stack frame.
91 var frame stkframe
96 frame.pc = 0
97 frame.fn = nil
98 frame.argp = 0
99 frame.arglen = 0
100 frame.argmap = nil
102 frame.pc = fn.fn
103 f := findfunc(frame.pc)
105 print("runtime: unknown pc in defer ", hex(frame.pc), "\n")
108 frame.fn = f
109 frame.argp = uintptr(deferArgs(d))
110 frame.arglen, frame.argmap = getArgInfo(&frame, f, true, fn)
112 frame.continpc = frame.pc
113 if !callback((*stkframe)(noescape(unsafe.Pointer(&frame))), v) {
168 var frame stkframe
169 frame.pc = pc0
170 frame.sp = sp0
172 frame.lr = lr0
184 // Start in the caller's frame.
185 if frame.pc == 0 {
187 frame.pc = *(*uintptr)(unsafe.Pointer(frame.sp))
188 frame.lr = 0
190 frame.pc = uintptr(*(*sys.Uintreg)(unsafe.Pointer(frame.sp)))
191 frame.sp += sys.RegSize
195 f := findfunc(frame.pc)
204 // savedLRPtr by some frame size.
220 frame.pc = gp.stkbar[stkbarPos].savedLRVal
222 f = findfunc(frame.pc)
226 print("runtime: unknown pc ", hex(frame.pc), "\n")
231 frame.fn = f
240 // fp is the frame pointer (caller's stack pointer) at that program counter, or nil if unknown.
243 f = frame.fn
245 // No frame information, must be external function, like race support.
251 // Derive frame pointer and link register.
252 if frame.fp == 0 {
256 sp := frame.sp
259 frame.sp = sp
264 frame.fp = sp + uintptr(funcspdelta(f, frame.pc, &cache))
267 frame.fp += sys.RegSize
272 frame.lr = 0
284 frame.lr = 0
288 if n == 0 && frame.sp < frame.fp || frame.lr == 0 {
289 lrPtr = frame.sp
290 frame.lr = *(*uintptr)(unsafe.Pointer(lrPtr))
293 if frame.lr == 0 {
294 lrPtr = frame.fp - sys.RegSize
295 frame.lr = uintptr(*(*sys.Uintreg)(unsafe.Pointer(lrPtr)))
298 if frame.lr == stackBarrierPC {
306 frame.lr = stkbar[0].savedLRVal
309 flr = findfunc(frame.lr)
316 print("runtime: unexpected return pc for ", funcname(f), " called from ", hex(frame.lr), "\n")
322 frame.varp = frame.fp
325 frame.varp -= sys.RegSize
328 // If framepointer_enabled and there's a frame, then
330 if framepointer_enabled && GOARCH == "amd64" && frame.varp > frame.sp {
331 frame.varp -= sys.RegSize
341 frame.argp = frame.fp + sys.MinFrameSize
342 frame.arglen, frame.argmap = getArgInfo(&frame, f, callback != nil, nil)
345 // Determine frame's 'continuation PC', where it can continue.
347 // is immediately below this function on the stack, then the frame
348 // stopped executing due to a trap, and frame.pc is probably not
355 frame.continpc = frame.pc
357 if _defer != nil && _defer.sp == frame.sp {
358 frame.continpc = _defer.pc
360 frame.continpc = 0
364 // Unwind our local defer stack past this frame.
365 for _defer != nil && (_defer.sp == frame.sp || _defer.sp == _NoArgs) {
375 (*[1 << 20]uintptr)(unsafe.Pointer(pcbuf))[n] = frame.pc
378 if !callback((*stkframe)(noescape(unsafe.Pointer(&frame))), v) {
388 tracepc := frame.pc // back up to CALL instruction for funcline.
389 if (n > 0 || flags&_TraceTrap == 0) && frame.pc > f.entry && !waspanic {
397 argp := (*[100]uintptr)(unsafe.Pointer(frame.argp))
398 for i := uintptr(0); i < frame.arglen/sys.PtrSize; i++ {
411 if frame.pc > f.entry {
412 print(" +", hex(frame.pc-f.entry))
415 print(" fp=", hex(frame.fp), " sp=", hex(frame.sp))
443 // Unwind to next frame.
444 frame.fn = flr
445 frame.pc = frame.lr
446 frame.lr = 0
447 frame.sp = frame.fp
448 frame.fp = 0
449 frame.argmap = nil
454 x := *(*uintptr)(unsafe.Pointer(frame.sp))
455 frame.sp += sys.MinFrameSize
458 frame.sp += sys.PtrSize
460 f = findfunc(frame.pc)
461 frame.fn = f
463 frame.pc = x
464 } else if funcspdelta(f, frame.pc, &cache) == 0 {
465 frame.lr = x
482 // because the defers on the panic stack do not nest in frame order as
485 // frame 1 defers d1
486 // frame 2 defers d2
487 // frame 3 defers d3
488 // frame 4 panics
489 // frame 4's panic starts running defers
490 // frame 5, running d3, defers d4
491 // frame 5 panics
492 // frame 5's panic starts running defers
493 // frame 6, running d4, garbage collects
494 // frame 6, running d2, garbage collects
497 // is nested properly, and we'll treat frame 3 as resumable, because we
498 // can find d3. (And in fact frame 3 is resumable. If d4 recovers
499 // and frame 5 continues running, d3, d3 can recover and we'll
500 // resume execution in (returning from) frame 3.)
503 // which is inverted. The scan will match d2 to frame 2 but having
504 frame 3.
507 // for frame 3 means we'll set frame 3's continpc == 0, which is correct
508 // (frame 3 is dead). At the end of the walk the panic stack can thus
510 // always indicates a dead frame, and the effect of the inversion on the
540 if callback != nil && n < max && frame.sp != gp.stktopsp {
541 print("runtime: g", gp.goid, ": frame.sp=", hex(frame.sp), " top=", hex(gp.stktopsp), "\n")
556 // getArgInfo returns the argument frame information for a call to f
557 // with call frame frame.
562 // the active stack frame). If this is a deferred call, ctxt must be
564 func getArgInfo(frame *stkframe, f *_func, needArgMap bool, ctxt *funcval) (arglen uintptr, argmap *bitvector) {
584 arg0 := frame.sp + sys.MinFrameSize
724 // Special case: always show runtime.gopanic frame