@@ -12,7 +12,7 @@ import (
1212
1313const (
1414 // maxStackDepthToCheck defines the maximum stack depth for runtime caller inspection.
15- maxStackDepthToCheck = 32
15+ maxStackDepthToCheck = 64
1616)
1717
1818var (
@@ -21,18 +21,18 @@ var (
2121)
2222
2323func firstExternalCaller () * runtime.Frame {
24- thisPC , _ , _ , ok := runtime .Caller (0 )
24+ thisProgCtr , _ , _ , ok := runtime .Caller (0 )
2525 if ! ok {
2626 return nil
2727 }
28- thisFunc := runtime .FuncForPC (thisPC )
28+ thisFunc := runtime .FuncForPC (thisProgCtr )
2929 pkgPrefix := getPackagePath (thisFunc )
3030
3131 // runtime.Callers (0), firstExternalCaller (1), the function calling firstExternalCaller (2)
3232 const skip = 2
33- pc := make ([]uintptr , maxStackDepthToCheck )
34- n := runtime .Callers (skip , pc )
35- frames := runtime .CallersFrames (pc [: n ])
33+ progCtrsAboveUs := make ([]uintptr , maxStackDepthToCheck )
34+ nProgCtrsAboveUs := runtime .Callers (skip , progCtrsAboveUs )
35+ frames := runtime .CallersFrames (progCtrsAboveUs [: nProgCtrsAboveUs ])
3636
3737 for {
3838 frame , more := frames .Next ()
0 commit comments