From 839766a06534721603074840c9ba981087c6429c Mon Sep 17 00:00:00 2001 From: WebFreak001 Date: Sat, 10 Sep 2016 22:22:10 +0200 Subject: [PATCH] Using undefined instead of "" for UI --- src/backend/mi2/mi2.ts | 6 +++--- src/mibase.ts | 16 +++++++++------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/backend/mi2/mi2.ts b/src/backend/mi2/mi2.ts index 71a4a00..742e6cc 100644 --- a/src/backend/mi2/mi2.ts +++ b/src/backend/mi2/mi2.ts @@ -525,9 +525,9 @@ export class MI2 extends EventEmitter implements IBackend { let from = parseInt(MINode.valueOf(element, "@frame.from")); ret.push({ address: addr, - fileName: filename || "", - file: file || "", - function: func || from || "", + fileName: filename, + file: file, + function: func || from, level: level, line: line }); diff --git a/src/mibase.ts b/src/mibase.ts index e354343..3342811 100644 --- a/src/mibase.ts +++ b/src/mibase.ts @@ -205,13 +205,15 @@ export class MI2DebugSession extends DebugSession { let ret: StackFrame[] = []; stack.forEach(element => { let file = element.file; - if (this.isSSH) { - file = relative(this.switchCWD.replace(/\\/g, "/"), file.replace(/\\/g, "/")); - file = systemPath.resolve(this.trimCWD.replace(/\\/g, "/"), file.replace(/\\/g, "/")); - } - else if (process.platform === "win32") { - if (file.startsWith("\\cygdrive\\") || file.startsWith("/cygdrive/")) { - file = file[10] + ":" + file.substr(11); // replaces /cygdrive/c/foo/bar.txt with c:/foo/bar.txt + if (file) { + if (this.isSSH) { + file = relative(this.switchCWD.replace(/\\/g, "/"), file.replace(/\\/g, "/")); + file = systemPath.resolve(this.trimCWD.replace(/\\/g, "/"), file.replace(/\\/g, "/")); + } + else if (process.platform === "win32") { + if (file.startsWith("\\cygdrive\\") || file.startsWith("/cygdrive/")) { + file = file[10] + ":" + file.substr(11); // replaces /cygdrive/c/foo/bar.txt with c:/foo/bar.txt + } } } ret.push(new StackFrame(element.level, element.function + "@" + element.address, new Source(element.fileName, file), element.line, 0));