Lines Matching full:gp

81 //	for u.init(gp, 0); u.valid(); u.next() {
118 // init initializes u to start unwinding gp's stack and positions the
119 // iterator on gp's innermost frame. gp must not be the current G.
122 func (u *unwinder) init(gp *g, flags unwindFlags) {
129 u.initAt(^uintptr(0), ^uintptr(0), ^uintptr(0), gp, flags)
132 func (u *unwinder) initAt(pc0, sp0, lr0 uintptr, gp *g, flags unwindFlags) {
133 // Don't call this "g"; it's too easy get "g" and "gp" confused.
134 if ourg := getg(); ourg == gp && ourg == ourg.m.curg {
151 if pc0 == ^uintptr(0) && sp0 == ^uintptr(0) { // Signal to fetch saved values from gp.
152 if gp.syscallsp != 0 {
153 pc0 = gp.syscallpc
154 sp0 = gp.syscallsp
159 pc0 = gp.sched.pc
160 sp0 = gp.sched.sp
162 lr0 = gp.sched.lr
203 print("runtime: g ", gp.goid, " gp=", gp, ": unknown pc ", hex(frame.pc), "\n")
204 tracebackHexdump(gp.stack, &frame, 0)
217 g: gp.guintptr(),
218 cgoCtxt: len(gp.cgoCtxt) - 1,
223 isSyscall := frame.pc == pc0 && frame.sp == sp0 && pc0 == gp.syscallpc && sp0 == gp.syscallsp
235 // gp.syscall*; this is otherwise ignored.
254 gp := u.g.ptr()
287 // This ensures gp.m doesn't change from a stack jump.
288 if u.flags&unwindJumpStack != 0 && gp == gp.m.g0 && gp.m.curg != nil && gp.m.curg.m == gp.m {
296 gp = gp.m.curg
297 u.g.set(gp)
298 frame.pc = gp.sched.pc
302 frame.lr = gp.sched.lr
303 frame.sp = gp.sched.sp
304 u.cgoCtxt = len(gp.cgoCtxt) - 1
319 gp = gp.m.curg
320 u.g.set(gp)
321 frame.sp = gp.sched.sp
322 u.cgoCtxt = len(gp.cgoCtxt) - 1
429 // gp._defer for a defer corresponding to this function, but that
443 gp := u.g.ptr()
458 if doPrint && gp.m.incgo && f.funcID == abi.FuncID_sigpanic {
466 …print("runtime: g ", gp.goid, ": unexpected return pc for ", funcname(f), " called from ", hex(fra…
467 tracebackHexdump(gp.stack, frame, 0)
480 tracebackHexdump(gp.stack, frame, frame.sp)
562 gp := u.g.ptr()
563 if u.flags&(unwindPrintErrors|unwindSilentErrors) == 0 && u.frame.sp != gp.stktopsp {
564 print("runtime: g", gp.goid, ": frame.sp=", hex(u.frame.sp), " top=", hex(gp.stktopsp), "\n")
565 print("\tstack=[", hex(gp.stack.lo), "-", hex(gp.stack.hi), "\n")
774 func printcreatedby(gp *g) {
776 pc := gp.gopc
778 if f.valid() && showframe(f.srcFunc(), gp, false, abi.FuncIDNormal) && gp.goid != 1 {
779 printcreatedby1(f, pc, gp.parentGoid)
802 func traceback(pc, sp, lr uintptr, gp *g) {
803 traceback1(pc, sp, lr, gp, 0)
807 // from a trap, not from gp->sched or gp->syscallpc/gp->syscallsp or getcallerpc/getcallersp.
812 // If gp.m.libcall{g,pc,sp} information is available, it uses that information in preference to
814 func tracebacktrap(pc, sp, lr uintptr, gp *g) {
815 if gp.m.libcallsp != 0 {
817 traceback1(gp.m.libcallpc, gp.m.libcallsp, 0, gp.m.libcallg.ptr(), 0)
820 traceback1(pc, sp, lr, gp, unwindTrap)
823 func traceback1(pc, sp, lr uintptr, gp *g, flags unwindFlags) {
825 …if iscgo && gp.m != nil && gp.m.ncgo > 0 && gp.syscallsp != 0 && gp.m.cgoCallers != nil && gp.m.cg…
832 gp.m.cgoCallersUse.Store(1)
833 cgoCallers := *gp.m.cgoCallers
834 gp.m.cgoCallers[0] = 0
835 gp.m.cgoCallersUse.Store(0)
840 if readgstatus(gp)&^_Gscan == _Gsyscall {
842 pc = gp.syscallpc
843 sp = gp.syscallsp
846 if gp.m != nil && gp.m.vdsoSP != 0 {
849 pc = gp.m.vdsoPC
850 sp = gp.m.vdsoSP
902 u.initAt(pc, sp, lr, gp, flags)
929 printcreatedby(gp)
931 if gp.ancestors == nil {
934 for _, ancestor := range *gp.ancestors {
964 gp := u.g.ptr()
974 if !(showRuntime || showframe(sf, gp, n == 0, callee)) {
1004 if gp.m != nil && gp.m.throwing >= throwTypeRuntime && gp == gp.m.curg || level >= 2 {
1095 gp := getg()
1099 u.initAt(pc, sp, 0, gp, unwindSilentErrors)
1105 func gcallers(gp *g, skip int, pcbuf []uintptr) int {
1107 u.init(gp, unwindSilentErrors)
1113 func showframe(sf srcFunc, gp *g, firstFrame bool, calleeID abi.FuncID) bool {
1115 if mp.throwing >= throwTypeRuntime && gp != nil && (gp == mp.curg || gp == mp.caughtsig.ptr()) {
1197 func goroutineheader(gp *g) {
1200 gpstatus := readgstatus(gp)
1214 if gpstatus == _Gwaiting && gp.waitreason != waitReasonZero {
1215 status = gp.waitreason.String()
1220 if (gpstatus == _Gwaiting || gpstatus == _Gsyscall) && gp.waitsince != 0 {
1221 waitfor = (nanotime() - gp.waitsince) / 60e9
1223 print("goroutine ", gp.goid)
1224 if gp.m != nil && gp.m.throwing >= throwTypeRuntime && gp == gp.m.curg || level >= 2 {
1225 print(" gp=", gp)
1226 if gp.m != nil {
1227 print(" m=", gp.m.id, " mp=", gp.m)
1239 if gp.lockedm != 0 {
1263 forEachGRace(func(gp *g) {
1264 …if gp == me || gp == curgp || readgstatus(gp) == _Gdead || isSystemGoroutine(gp, false) && level <…
1268 goroutineheader(gp)
1269 // Note: gp.m == getg().m occurs when tracebackothers is called
1273 if gp.m != getg().m && readgstatus(gp)&^_Gscan == _Grunning {
1275 printcreatedby(gp)
1277 traceback(^uintptr(0), ^uintptr(0), 0, gp)
1337 func isSystemGoroutine(gp *g, fixed bool) bool {
1339 f := findfunc(gp.startpc)