nextSymbol parses the nm output to find the next symbol listed. Skips over any output it cannot recognize.
(buf *bytes.Buffer)
| 162 | // nextSymbol parses the nm output to find the next symbol listed. |
| 163 | // Skips over any output it cannot recognize. |
| 164 | func nextSymbol(buf *bytes.Buffer) (uint64, string, error) { |
| 165 | for { |
| 166 | line, err := buf.ReadString('\n') |
| 167 | if err != nil { |
| 168 | if err != io.EOF || line == "" { |
| 169 | return 0, "", err |
| 170 | } |
| 171 | } |
| 172 | line = strings.TrimSpace(line) |
| 173 | |
| 174 | if fields := nmOutputRE.FindStringSubmatch(line); len(fields) == 4 { |
| 175 | if address, err := strconv.ParseUint(fields[1], 16, 64); err == nil { |
| 176 | return address, fields[3], nil |
| 177 | } |
| 178 | } |
| 179 | } |
| 180 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…