Using undefined instead of "<unknown>" for UI
This commit is contained in:
parent
b2d23d6e10
commit
839766a065
2 changed files with 12 additions and 10 deletions
|
|
@ -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
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -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));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue