| 153 | } |
| 154 | |
| 155 | function macCppfiltNm(out) { |
| 156 | // Re-grouped copy-paste from `tickprocessor.js` |
| 157 | const FUNC_RE = /^([0-9a-fA-F]{8,16} [iItT] )(.*)$/gm; |
| 158 | const CLEAN_RE = /^[0-9a-fA-F]{8,16} [iItT] /; |
| 159 | let entries = out.match(FUNC_RE); |
| 160 | if (entries === null) |
| 161 | return out; |
| 162 | |
| 163 | entries = entries.map((entry) => entry.replace(CLEAN_RE, '')); |
| 164 | |
| 165 | let filtered; |
| 166 | try { |
| 167 | filtered = cp.spawnSync('c++filt', [ '-p', '-i' ], { |
| 168 | input: entries.join('\n'), |
| 169 | }).stdout.toString(); |
| 170 | } catch { |
| 171 | return out; |
| 172 | } |
| 173 | |
| 174 | let i = 0; |
| 175 | filtered = filtered.split('\n'); |
| 176 | return out.replace(FUNC_RE, (all, prefix, postfix) => { |
| 177 | return prefix + (filtered[i++] || postfix); |
| 178 | }); |
| 179 | } |
| 180 | |
| 181 | module.exports = { |
| 182 | globals: { |