Skip to content
This repository was archived by the owner on Jul 15, 2023. It is now read-only.

Fix remote path bug (#2010)#3108

Merged
ramya-rao-a merged 2 commits intomicrosoft:masterfrom
quoctruong:quoct/remote_path
Mar 19, 2020
Merged

Fix remote path bug (#2010)#3108
ramya-rao-a merged 2 commits intomicrosoft:masterfrom
quoctruong:quoct/remote_path

Conversation

@quoctruong
Copy link
Copy Markdown
Contributor

This is to fix #2010. When we are remote debugging cross-compiled binary on Windows, we are not respecting the separator that users use in remotePath field.

if (/^(\w:[\\/]|\\\\)/.test(filePath)) {
return '\\';
}
return filePath.includes('/') ? '/' : '\\';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a possibility that the path has both / and ? The new change selects / in that case while the old findPathSeparator picks \ if it matches the above pattern (in line 758). Wonder if that would be potentially a problem.

// than the local path separator (cross-compilation),
// the split and join logic won't work.
// See github.com/microsoft/vscode-go/issues/2010.
filePath = filePath.replace(/\/|\\/g, this.remotePathSeparator);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wonder if it's doable to write some unit tests to check these path manipulation functions.

Comment thread src/debugAdapter/goDebug.ts Outdated
Co-Authored-By: Ramya Rao <ramya.rao.a@outlook.com>
@ramya-rao-a ramya-rao-a merged commit 7da5077 into microsoft:master Mar 19, 2020
hyangah added a commit to hyangah/vscode-go-old that referenced this pull request Mar 19, 2020
Sync @ 7da5077

* master:
  Address mismatch on path separators in debug config (microsoft#2010) (microsoft#3108)
  Include the link to release note/package overview in the update prompt, and update gopls default version (microsoft#3041)
  bug_report.md: Fix "architecture" typo. (microsoft#3095)
  telemetry.ts: send telemetry only if aiKey is not an empty  string(microsoft#3091)
gopherbot referenced this pull request in golang/vscode-go Mar 20, 2020
 Merge 'microsoft/vscode-go/master' into 'golang/vscode-go/master'

    Sync @ 7da5077

    * master:
      Address mismatch on path separators in debug config (#2010) (#3108)
      Include the link to release note/package overview in the update prompt, and update gopls default version (#3041)
      bug_report.md: Fix "architecture" typo. (#3095)
      telemetry.ts: send telemetry only if aiKey is not an empty  string(#3091)

Change-Id: I727ef0ed3b8d1ad926e26831534c153b06070e64
GitHub-Last-Rev: d11e342
GitHub-Pull-Request: #11
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/224239
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
hyangah added a commit to hyangah/vscode-go-old that referenced this pull request Mar 20, 2020
* master:
  goLanguageServer: set completion follow up command from middleware (microsoft#3084)
  Add stacktrace dump and better error messages on EXC_BAD_ACCESS panics (microsoft#2904)
  Address mismatch on path separators in debug config (microsoft#2010) (microsoft#3108)
  Include the link to release note/package overview in the update prompt, and update gopls default version (microsoft#3041)
  bug_report.md: Fix "architecture" typo. (microsoft#3095)
  telemetry.ts: send telemetry only if aiKey is not an empty  string(microsoft#3091)
hyangah added a commit to hyangah/vscode-go-old that referenced this pull request Mar 20, 2020
…sync

microsoft/vscode-go@d53b1b3

* 'master' of https://github.com/microsoft/vscode-go:
  goLanguageServer: set completion follow up command from middleware (microsoft#3084)
  Add stacktrace dump and better error messages on EXC_BAD_ACCESS panics (microsoft#2904)
  Address mismatch on path separators in debug config (microsoft#2010) (microsoft#3108)
gopherbot referenced this pull request in golang/vscode-go Mar 20, 2020
Merge branch 'master' of https://github.com/microsoft/vscode-go@d53b1b3

* 'master' of https://github.com/microsoft/vscode-go:
  goLanguageServer: set completion follow up command from middleware (microsoft#3084)
  Add stacktrace dump and better error messages on EXC_BAD_ACCESS panics (microsoft#2904)
  Address mismatch on path separators in debug config (microsoft#2010) (microsoft#3108)

Created by

`git pull --no-ff --log upstream master`

Change-Id: Id38768f3ec1bd01fa81325978f51f314fc1c08cb
GitHub-Last-Rev: 3a8de3f
GitHub-Pull-Request: #17
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/224240
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Breakpoints set in VS Code not hit (docker remote debugging)

3 participants