matchSymbol checks if a symbol is to be selected by checking its name to the regexp and optionally its address. It returns the name(s) to be used for the matched symbol, or nil if no match
(names []string, start, end uint64, r *regexp.Regexp, address uint64)
| 84 | // name to the regexp and optionally its address. It returns the name(s) |
| 85 | // to be used for the matched symbol, or nil if no match |
| 86 | func matchSymbol(names []string, start, end uint64, r *regexp.Regexp, address uint64) []string { |
| 87 | if address != 0 && address >= start && address <= end { |
| 88 | return names |
| 89 | } |
| 90 | for _, name := range names { |
| 91 | if r == nil || r.MatchString(name) { |
| 92 | return []string{name} |
| 93 | } |
| 94 | |
| 95 | // Match all possible demangled versions of the name. |
| 96 | for _, o := range [][]demangle.Option{ |
| 97 | {demangle.NoClones}, |
| 98 | {demangle.NoParams, demangle.NoEnclosingParams}, |
| 99 | {demangle.NoParams, demangle.NoEnclosingParams, demangle.NoTemplateParams}, |
| 100 | } { |
| 101 | if demangled, err := demangle.ToString(name, o...); err == nil && r.MatchString(demangled) { |
| 102 | return []string{demangled} |
| 103 | } |
| 104 | } |
| 105 | } |
| 106 | return nil |
| 107 | } |
| 108 | |
| 109 | // disassemble parses the output of the objdump command and returns |
| 110 | // the assembly instructions in a slice. |
no outgoing calls
no test coverage detected
searching dependent graphs…