MCPcopy Index your code
hub / github.com/nodejs/node / processStack

Method processStack

deps/v8/tools/logreader.mjs:190–209  ·  view source on GitHub ↗

* Processes stack record. * * @param {number} pc Program counter. * @param {number} func JS Function. * @param {string[]} stack String representation of a stack. * @return {number[]} Processed stack.

(pc, func, stack)

Source from the content-addressed store, hash-verified

188 * @return {number[]} Processed stack.
189 */
190 processStack(pc, func, stack) {
191 const fullStack = func ? [pc, func] : [pc];
192 let prevFrame = pc;
193 const length = stack.length;
194 for (let i = 0, n = length; i < n; ++i) {
195 const frame = stack[i];
196 const firstChar = frame[0];
197 if (firstChar === '+' || firstChar === '-') {
198 // An offset from the previous frame.
199 prevFrame += this.parseFrame(frame);
200 fullStack.push(prevFrame);
201 // Filter out possible 'overflow' string.
202 } else if (firstChar !== 'o') {
203 fullStack.push(this.parseFrame(frame));
204 } else {
205 console.error(`Dropping unknown tick frame: ${frame}`);
206 }
207 }
208 return fullStack;
209 }
210
211 /**
212 * Does a dispatch of a log record.

Callers 2

processTickMethod · 0.80
processTickMethod · 0.80

Calls 2

pushMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected