Fixed cygdrive paths in stack request (fix #72)

This commit is contained in:
WebFreak001 2016-09-04 17:11:20 +02:00
commit bf519c8bab

View file

@ -209,6 +209,11 @@ export class MI2DebugSession extends DebugSession {
file = relative(this.switchCWD.replace(/\\/g, "/"), file.replace(/\\/g, "/")); file = relative(this.switchCWD.replace(/\\/g, "/"), file.replace(/\\/g, "/"));
file = systemPath.resolve(this.trimCWD.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)); ret.push(new StackFrame(element.level, element.function + "@" + element.address, new Source(element.fileName, file), element.line, 0));
}); });
response.body = { response.body = {
@ -340,15 +345,13 @@ export class MI2DebugSession extends DebugSession {
} }
else { else {
if (typeof expanded == "string") { if (typeof expanded == "string") {
if (expanded == "<nullptr>") if (expanded == "<nullptr>") {
{
if (argsPart) if (argsPart)
argsPart = false; argsPart = false;
else else
return submit(); return submit();
} }
else if (expanded[0] != '"') else if (expanded[0] != '"') {
{
strArr.push({ strArr.push({
name: "[err]", name: "[err]",
value: expanded, value: expanded,