Skip to content

Attach mode hang forever when cwd is empty #1608

Closed
@icexin

Description

@icexin

For asking questions, see:

Before filing an issue, please review our troubleshooting guides

Please answer these questions before submitting your issue. Thanks!

What version of Go, VS Code & VS Code Go extension are you using?

  • Run go version to get version of Go from the VS Code integrated terminal.
    • go version go1.13.8 darwin/amd64
  • Run gopls -v version to get version of Gopls from the VS Code integrated terminal.
Build info
----------
golang.org/x/tools/gopls v0.7.0
    golang.org/x/tools/[email protected] h1:JQBHW81Gsyim6iDjUwGoPeSpXrSqwen3isPJLfDf=
    github.com/google/[email protected] h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlr=
    github.com/sergi/[email protected] h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+e=
    golang.org/x/[email protected] h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo=
    golang.org/x/[email protected] h1:5KslGYwFpkhGh+Q16bw=
    golang.org/x/[email protected] h1:gG67DSER+11cZvqIMb8S=
    golang.org/x/[email protected] h1:Pv9gNyJFYVdpUAVZ=
    golang.org/x/[email protected] h1:go1bK/D/BFZV2I8c=
    mvdan.cc/[email protected] h1:bi/1aS/5W00E2ny5q65w9SnKpWEF/UIOqDYBILpo9rA=
    mvdan.cc/xurls/[email protected] h1:NSZPykBXJFCetGZykLAxaL6SIpvbVy/UFEniIfHAa8A=
  • Run code -v or code-insiders -v to get version of VS Code or VS Code Insiders.

    1.57.1
    507ce72a4466fbb27b715c3722558bb15afa9f48
    x64
    
  • Check your installed extensions to get the version of the VS Code Go extension

    • 0.26.0
  • Run Ctrl+Shift+P (Cmd+Shift+P on Mac OS) > Go: Locate Configured Go Tools command.

Checking configured tools....
GOBIN: undefined
toolsGopath: 
gopath: /Users/fanbingxin/go
GOROOT: /Users/fanbingxin/local/go
PATH: /Users/fanbingxin/bin:/Users/fanbingxin/go/bin:/Users/fanbingxin/local/go/bin:/Users/fanbingxin/local/maven/bin:/Users/fanbingxin/.cargo/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware Fusion.app/Contents/Public:/usr/local/go/bin:/Applications/Wireshark.app/Contents/MacOS

   gopkgs: /Users/fanbingxin/go/bin/gopkgs installed
   go-outline: /Users/fanbingxin/go/bin/go-outline installed
   gotests: gotests not installed
   gomodifytags: gomodifytags not installed
   impl: /Users/fanbingxin/go/bin/impl installed
   goplay: goplay not installed
   dlv: /Users/fanbingxin/go/bin/dlv installed
   dlv-dap: dlv-dap not installed
   staticcheck: staticcheck not installed
   gopls: /Users/fanbingxin/go/bin/gopls installed

go env
Workspace Folder (eggos): /Users/fanbingxin/go/src/github.com/icexin/eggos
	GO111MODULE="on"
	GOARCH="386"
	GOBIN=""
	GOCACHE="/Users/fanbingxin/Library/Caches/go-build"
	GOENV="/Users/fanbingxin/Library/Application Support/go/env"
	GOEXE=""
	GOFLAGS=""
	GOHOSTARCH="amd64"
	GOHOSTOS="darwin"
	GONOPROXY=""
	GONOSUMDB=""
	GOOS="linux"
	GOPATH="/Users/fanbingxin/go"
	GOPRIVATE=""
	GOPROXY="https://goproxy.cn"
	GOROOT="/Users/fanbingxin/local/go"
	GOSUMDB="sum.golang.org"
	GOTMPDIR=""
	GOTOOLDIR="/Users/fanbingxin/local/go/pkg/tool/darwin_amd64"
	GCCGO="gccgo"
	GO386="sse2"
	AR="ar"
	CC="clang"
	CXX="clang++"
	CGO_ENABLED="0"
	GOMOD="/Users/fanbingxin/go/src/github.com/icexin/eggos/go.mod"
	CGO_CFLAGS="-g -O2"
	CGO_CPPFLAGS=""
	CGO_CXXFLAGS="-g -O2"
	CGO_FFLAGS="-g -O2"
	CGO_LDFLAGS="-g -O2"
	PKG_CONFIG="pkg-config"
	GOGCCFLAGS="-fPIC -m32 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/f8/0879kt7j4791j6lrfz2ydb4h0000gp/T/go-build350734622=/tmp/go-build -gno-record-gcc-switches"

Share the Go related settings you have added/edited

{
    "go.toolsEnvVars": {
        "GOOS": "linux",
        "GOARCH": "386",
    },
}

Describe the bug

In debug mode, if I select the request field as attach and the cwd field is empty, vscode will not respond after clicking the debug button.

Steps to reproduce the behavior:

configuration of debug:

 {
            "name": "dlv-gdb",
            "type": "go",
            "request": "attach",
            "mode": "local",
            //"cwd": "${workspaceFolder}",
            "debugAdapter": "legacy",
            "processId": 1234,
            "backend": "lldb",
            "dlvFlags": [
                "${workspaceRoot}/kernel.elf",
            ],
            "trace": "log",
        },

Metadata

Metadata

Assignees

No one assigned

    Labels

    DebugIssues related to the debugging functionality of the extension.FrozenDueToAgedebug/legacylegacy debug adapter related issues - new issues won't be fixed

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions