Giter Site home page Giter Site logo

Comments (10)

koxu1996 avatar koxu1996 commented on May 19, 2024 4

This is side comment that might help someone. Documentation regarding path mapping is not explaining clearly how to set it up and how it works. I had to investigate code and that allowed me to understand two things:

  • remotePath keyword is misleading, because it's path to sources during executable build. Even if you move sources, then you must provide original one (I think they are compiled in), so for me name like originalBuildPath would be more clear.
  • local path setup - this is actually path obtained from cwd, but I would prefer setting something like localPath explicitly.

from vscode-go.

gopherbot avatar gopherbot commented on May 19, 2024

Change https://golang.org/cl/234020 mentions this issue: Add logic to infer remote path automatically

from vscode-go.

sbalabanov avatar sbalabanov commented on May 19, 2024

Does running ListPackagesBuildInfo involve discovering go packages, and thus running 'go list' on remote side? If so, getting this information can be pretty expensive.

In loaded IDE, we can know folders paths from opened project metadata, along with GOPATH and GOROOT. In 99.(9)% of the cases this is enough to match the remote file with the local one.

One concern that I have is that getting a list of all source paths from remote may be expensive.

from vscode-go.

gopherbot avatar gopherbot commented on May 19, 2024

Change https://golang.org/cl/236017 mentions this issue: src/debugAdapter/goDebug: add extra check for remote path inference

from vscode-go.

hyangah avatar hyangah commented on May 19, 2024

BTW, is it possible for users to offer a delve configuration with explicit path mapping info currently?

from vscode-go.

polinasok avatar polinasok commented on May 19, 2024

Yes, for now, but there is talk of taking out that option once this one is stable. The problem is that a single path option can only point to either user's source code or 3rd party library in a different directory, but not both.

from vscode-go.

hyangah avatar hyangah commented on May 19, 2024

@polinasok Maybe my question was not specific. I am asking if users can supply config.yml that supports multiple path substitution.

from vscode-go.

shaunco avatar shaunco commented on May 19, 2024

@koxu1996 - Thank you! I spent far too long trying to get breakpoints to work during a remote debug session between vscode on windows and delv in an ubuntu docker. Setting remotePath to the go workspace directory the binary was built from (even though it had no relation to the windows machine) and then setting cwd to ${workspaceFolder}, and everything worked.

It would be awesome if the vscode-go extension could just try remapping whatever paths are in the binary on the remote machine to the currently opened ${workspaceFolder}, as it seems like the most likely case.

https://github.com/golang/vscode-go/blob/master/docs/debugging.md#remote-debugging is also out of date and still mentions using program instead of cwd, among other things.

from vscode-go.

gopherbot avatar gopherbot commented on May 19, 2024

Change https://golang.org/cl/253741 mentions this issue: docs/debugging.md: update remote debugging documentation

from vscode-go.

hyangah avatar hyangah commented on May 19, 2024

We updated the section for remote debugging. Please review and if you find it's still unclear and needs improvement, please file a new issue or submit your PRs.

from vscode-go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.