1
2
3
4
5 package objabi
6
7 import (
8 "internal/abi"
9 "strings"
10 )
11
12 var funcIDs = map[string]abi.FuncID{
13 "abort": abi.FuncID_abort,
14 "asmcgocall": abi.FuncID_asmcgocall,
15 "asyncPreempt": abi.FuncID_asyncPreempt,
16 "cgocallback": abi.FuncID_cgocallback,
17 "corostart": abi.FuncID_corostart,
18 "debugCallV2": abi.FuncID_debugCallV2,
19 "gcBgMarkWorker": abi.FuncID_gcBgMarkWorker,
20 "rt0_go": abi.FuncID_rt0_go,
21 "goexit": abi.FuncID_goexit,
22 "gogo": abi.FuncID_gogo,
23 "gopanic": abi.FuncID_gopanic,
24 "handleAsyncEvent": abi.FuncID_handleAsyncEvent,
25 "main": abi.FuncID_runtime_main,
26 "mcall": abi.FuncID_mcall,
27 "morestack": abi.FuncID_morestack,
28 "mstart": abi.FuncID_mstart,
29 "panicwrap": abi.FuncID_panicwrap,
30 "runfinq": abi.FuncID_runfinq,
31 "sigpanic": abi.FuncID_sigpanic,
32 "systemstack_switch": abi.FuncID_systemstack_switch,
33 "systemstack": abi.FuncID_systemstack,
34
35
36 "deferreturn": abi.FuncIDWrapper,
37 }
38
39
40
41 func GetFuncID(name string, isWrapper bool) abi.FuncID {
42 if isWrapper {
43 return abi.FuncIDWrapper
44 }
45 if strings.HasPrefix(name, "runtime.") {
46 if id, ok := funcIDs[name[len("runtime."):]]; ok {
47 return id
48 }
49 }
50 return abi.FuncIDNormal
51 }
52
View as plain text