MCPcopy Create free account
hub / github.com/nodejs/node / macCppfiltNm

Function macCppfiltNm

lib/internal/v8_prof_polyfill.js:155–179  ·  view source on GitHub ↗
(out)

Source from the content-addressed store, hash-verified

153}
154
155function 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
181module.exports = {
182 globals: {

Callers 1

Calls 5

matchMethod · 0.65
mapMethod · 0.65
toStringMethod · 0.45
joinMethod · 0.45
splitMethod · 0.45

Tested by

no test coverage detected