MCPcopy Index your code
hub / github.com/apache/devlake / GatherCallFrames

Function GatherCallFrames

backend/core/utils/callframes.go:42–68  ·  view source on GitHub ↗

GatherCallFrames FIXME ...

(delta int)

Source from the content-addressed store, hash-verified

40
41// GatherCallFrames FIXME ...
42func GatherCallFrames(delta int) string {
43 var name, file string
44 var line int
45 var pc [16]uintptr
46
47 n := runtime.Callers(3+delta, pc[:])
48 for _, pc := range pc[:n] {
49 fn := runtime.FuncForPC(pc)
50 if fn == nil {
51 continue
52 }
53 file, line = fn.FileLine(pc)
54 name = fn.Name()
55 if !strings.HasPrefix(name, "runtime.") {
56 break
57 }
58 }
59
60 switch {
61 case name != "":
62 return fmt.Sprintf("%v:%v", name, line)
63 case file != "":
64 return fmt.Sprintf("%v:%v", file, line)
65 }
66
67 return fmt.Sprintf("pc:%x", pc)
68}

Callers

nothing calls this directly

Calls 1

NameMethod · 0.65

Tested by

no test coverage detected