8.8.1.1.1.2.3. Callstack¶
- interface Callstack()¶
- fetch(maxLevels?: number)¶
Fetches the callstack.
let {frames, reasonUnwindHalted} = session.callstack.fetch(); // For each frame in the callstack, print the info about the frame for (let i = 0; i < frames.length; i++) { let {functionName, sourceLine, pc} = frames[i]; const functionDisplay = functionName || "<symbol is not available>"; if (sourceLine) { let {path, line, column} = sourceLine; console.log(`${i} ${functionDisplay} at ${path}:${line}:${column} PC = ${pc}`); } else { console.log(`${i} ${functionDisplay} PC = ${pc}`); } }
- Parameters:
maxLevels (
number | null) -- The maximum number of frames to fetch. Defaults to all frames.
- Return type:
CallstackResult