Using undefined instead of "<unknown>" for UI

This commit is contained in:
WebFreak001 2016-09-10 22:22:10 +02:00
commit 839766a065
2 changed files with 12 additions and 10 deletions

View file

@ -525,9 +525,9 @@ export class MI2 extends EventEmitter implements IBackend {
let from = parseInt(MINode.valueOf(element, "@frame.from")); let from = parseInt(MINode.valueOf(element, "@frame.from"));
ret.push({ ret.push({
address: addr, address: addr,
fileName: filename || "", fileName: filename,
file: file || "<unknown>", file: file,
function: func || from || "<unknown>", function: func || from,
level: level, level: level,
line: line line: line
}); });

View file

@ -205,13 +205,15 @@ export class MI2DebugSession extends DebugSession {
let ret: StackFrame[] = []; let ret: StackFrame[] = [];
stack.forEach(element => { stack.forEach(element => {
let file = element.file; let file = element.file;
if (this.isSSH) { if (file) {
file = relative(this.switchCWD.replace(/\\/g, "/"), file.replace(/\\/g, "/")); if (this.isSSH) {
file = systemPath.resolve(this.trimCWD.replace(/\\/g, "/"), file.replace(/\\/g, "/")); 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/")) { else if (process.platform === "win32") {
file = file[10] + ":" + file.substr(11); // replaces /cygdrive/c/foo/bar.txt with c:/foo/bar.txt 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)); ret.push(new StackFrame(element.level, element.function + "@" + element.address, new Source(element.fileName, file), element.line, 0));