MCPcopy Index your code
hub / github.com/WebFreak001/code-debug / stackTraceRequest

Method stackTraceRequest

src/mibase.ts:287–319  ·  view source on GitHub ↗
(response: DebugProtocol.StackTraceResponse, args: DebugProtocol.StackTraceArguments)

Source from the content-addressed store, hash-verified

285 }
286
287 protected stackTraceRequest(response: DebugProtocol.StackTraceResponse, args: DebugProtocol.StackTraceArguments): void {
288 this.miDebugger.getStack(args.startFrame, args.levels, args.threadId).then(stack => {
289 const ret: StackFrame[] = [];
290 stack.forEach(element => {
291 let source = undefined;
292 let path = element.file;
293 if (path) {
294 if (this.isSSH) {
295 // convert ssh path to local path
296 path = this.sourceFileMap.toLocalPath(path);
297 } else if (process.platform === "win32") {
298 if (path.startsWith("\\cygdrive\\") || path.startsWith("/cygdrive/")) {
299 path = path[10] + ":" + path.substring(11); // replaces /cygdrive/c/foo/bar.txt with c:/foo/bar.txt
300 }
301 }
302 source = new Source(element.fileName, path);
303 }
304
305 ret.push(new StackFrame(
306 this.threadAndLevelToFrameId(args.threadId, element.level),
307 element.function + "@" + element.address,
308 source,
309 element.line,
310 0));
311 });
312 response.body = {
313 stackFrames: ret
314 };
315 this.sendResponse(response);
316 }, err => {
317 this.sendErrorResponse(response, 12, `Failed to get Stack Trace: ${err.toString()}`);
318 });
319 }
320
321 protected configurationDoneRequest(response: DebugProtocol.ConfigurationDoneResponse, args: DebugProtocol.ConfigurationDoneArguments): void {
322 const promises: Thenable<any>[] = [];

Callers

nothing calls this directly

Calls 4

toLocalPathMethod · 0.80
toStringMethod · 0.80
getStackMethod · 0.65

Tested by

no test coverage detected