From d24062f06c5c8fd471dcdffac39915c664099626 Mon Sep 17 00:00:00 2001 From: Baptist BENOIST Date: Wed, 10 Feb 2016 11:19:45 +0100 Subject: [PATCH] Fix invalid local windows path when using GDB over SSH Because of the global POSIX configuration for path-related processing, the local absolute paths of files with a breakpoint were not translated correctly. This fix forces the use of the default NodeJS path.resolve instead of the global POSIX override. --- src/gdb.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gdb.ts b/src/gdb.ts index a14e4a5..8108674 100644 --- a/src/gdb.ts +++ b/src/gdb.ts @@ -5,6 +5,7 @@ import { MINode } from './backend/mi_parse' import { expandValue, isExpandable } from './backend/gdb_expansion' import { MI2 } from './backend/mi2/mi2' import { posix } from "path" +import * as systemPath from "path" let resolve = posix.resolve; let relative = posix.relative; @@ -197,7 +198,7 @@ class MI2DebugSession extends DebugSession { let file = element.file; if (this.isSSH) { file = relative(this.switchCWD.replace(/\\/g, "/"), file.replace(/\\/g, "/")); - file = resolve(this.trimCWD.replace(/\\/g, "/"), file.replace(/\\/g, "/")); + file = systemPath.resolve(this.trimCWD.replace(/\\/g, "/"), file.replace(/\\/g, "/")); } ret.push(new StackFrame(element.level, element.function + "@" + element.address, new Source(element.fileName, file), element.line, 0)); });