Skip to content

debug: breakpoints don't work when working with symlink #622

Closed
@hyangah

Description

@hyangah

Continuation of microsoft/vscode-go#2958 (lost during repo migration) and microsoft/vscode-go#1935. If we can't find a fix, we need to document this problem at least.

cc @suzmue @quoctruong

From microsoft/vscode-go#2958:

It is a continuation of an issue #1935

Unfortunately, the conversation there was locked to members only, so I had to open this card.

I have been able to reproduce the behavior (VSCode does not stop at breakpoints, while dlv itself does) for the symlinked GOPATH on two separate Ubuntu 19.10 installations, and I am pretty sure the issue is reproducible in other distros this way as well.

Set up to reproduce:

  1. Install go via package manager (both apt and snap work, mainly tested with snap, version go1.13.5 linux/amd64)
  2. Create a future GOPATH as ~/go
  3. Add GOPATH to your ~/.bashrc:
export GOPATH=`builtin cd ~/go && pwd`
export PATH=$PATH:$GOPATH/bin
  1. Create/clone a project folder in ~/go/src/github.com/<your_github_name>/<your_repo_name>
  2. Symlink ~/go/src/github.com to ~/GitHub
  3. Set up Go support for VSCode just as it is recommended in the guide, or follow the UI recommendations & install all the libraries it now wants
  4. Create a trivial main.go to try out the breakpoints:
package main

import "fmt"

func main() {
	fmt.Println("Hello World!")
	i := 101
	fmt.Println(i)
}

Reproducing

  • If you open ~/go/src/github.com/<your_github_name>/<your_repo_name> folder and set a breakpoint at i := 101, the execution would be successfully paused at it.
  • However, if you open ~/GitHub/<your_github_name>/<your_repo_name> folder and set the breakpoint, it will never be hit.
    No launch configuration was created, all default - debug was in both cases launched just by a press of F5.

Unfortunately, I have not been able to take a look inside the debugger yet, but at least this reproduction scenario might be helpful

Metadata

Metadata

Assignees

No one assigned

    Labels

    DebugIssues related to the debugging functionality of the extension.DocumentationFrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions