Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'remote' mode with 'dlv-dap' debugAdapter must connect to an external dlv --headless server @ v1.7.3 or later #2018

Closed
tekumara opened this issue Jan 15, 2022 · 10 comments
Assignees
Labels
Debug Issues related to the debugging functionality of the extension. FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@tekumara
Copy link

tekumara commented Jan 15, 2022

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

Version Information
  • Run go version to get version of Go from the VS Code integrated terminal.
go version go1.17.5 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.4
    golang.org/x/tools/gopls@v0.7.4 h1:hw8cpqjio1iMwIKbbDkG3MeW4l8R9dY/yqOHqv7HImA=
    github.com/BurntSushi/toml@v0.4.1 h1:GaI7EiDXDRfa8VshkTj7Fym7ha+y8/XxIgD2okUIjLw=
    github.com/google/go-cmp@v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ=
    github.com/sergi/go-diff@v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
    golang.org/x/mod@v0.5.1 h1:OJxoQ/rynoF0dcCdI7cLPktw/hR2cueqYfjm43oqK38=
    golang.org/x/sync@v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
    golang.org/x/sys@v0.0.0-20211019181941-9d821ace8654 h1:id054HUawV2/6IGm2IV8KZQjqtwAOo2CYlOToYqa0d0=
    golang.org/x/text@v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
    golang.org/x/tools@v0.1.9-0.20211209172050-90a85b2969be h1:JRBiPXZpZ1FsceyPRRme0vX394zXC3xlhqu705k9nzM=
    golang.org/x/xerrors@v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
    honnef.co/go/tools@v0.2.1 h1:/EPr//+UMMXwMTkXvCCoaJDq8cpjMO80Ou+L4PDo2mY=
    mvdan.cc/gofumpt@v0.1.1 h1:bi/1aS/5W00E2ny5q65w9SnKpWEF/UIOqDYBILpo9rA=
    mvdan.cc/xurls/v2@v2.3.0 h1:59Olnbt67UKpxF1EwVBopJvkSUBmgtb468E4GVWIZ1I=
  • Run code -v or code-insiders -v to get version of VS Code or VS Code Insiders.
1.63.2
899d46d82c4c95423fb7e10e68eba52050e30ba3
x64
  • Check your installed extensions to get the version of the VS Code Go extension
v0.30.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/tekumara/go
GOROOT: /usr/local/Cellar/go/1.17.5/libexec
PATH: /Users/tekumara/.cargo/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:/opt/X11/bin:~/.dotnet/tools

	go:	/usr/local/bin/go: go version go1.17.5 darwin/amd64

	gopkgs:	/Users/tekumara/go/bin/gopkgs: go1.17
		path	github.com/uudashr/gopkgs/v2/cmd/gopkgs
		mod	github.com/uudashr/gopkgs/v2	v2.1.2	h1:A0+QH6wqNRHORJnxmqfeuBEsK4nYQ7pgcOHhqpqcrpo=
		dep	github.com/karrick/godirwalk	v1.12.0	h1:nkS4xxsjiZMvVlazd0mFyiwD4BR9f3m6LXGhM2TUx3Y=
		dep	github.com/pkg/errors	v0.8.1	h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
	
	go-outline:	/Users/tekumara/go/bin/go-outline: go1.17
		path	github.com/ramya-rao-a/go-outline
		mod	github.com/ramya-rao-a/go-outline	v0.0.0-20210608161538-9736a4bde949	h1:iaD+iVf9xGfajsJp+zYrg9Lrk6gMJ6/hZHO4cYq5D5o=
		dep	golang.org/x/tools	v0.1.1	h1:wGiQel/hW0NnEkJUk8lbzkX2gFJU6PFxf1v5OlCfuOs=
	
	gotests:	not installed
	gomodifytags:	not installed
	impl:	not installed
	goplay:	not installed
	dlv:	/Users/tekumara/go/bin/dlv: go1.17.5
		path	github.com/go-delve/delve/cmd/dlv
		mod	github.com/go-delve/delve	v1.8.0	h1:uvwPyfr6n2g1S6/bt270lM4fBK76P/3FDCufOsK0CjQ=
		dep	github.com/cilium/ebpf	v0.7.0	h1:1k/q3ATgxSXRdrmPfH8d7YK0GfqVsEKZAX9dQZvs56k=
		dep	github.com/cosiner/argv	v0.1.0	h1:BVDiEL32lwHukgJKP87btEPenzrrHUjajs/8yzaqcXg=
		dep	github.com/cpuguy83/go-md2man/v2	v2.0.0	h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM=
		dep	github.com/derekparker/trie	v0.0.0-20200317170641-1fdf38b7b0e9	h1:G765iDCq7bP5opdrPkXk+4V3yfkgV9iGFuheWZ/X/zY=
		dep	github.com/google/go-dap	v0.6.0	h1:Y1RHGUtv3R8y6sXq2dtGRMYrFB2hSqyFVws7jucrzX4=
		dep	github.com/hashicorp/golang-lru	v0.5.4	h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc=
		dep	github.com/mattn/go-isatty	v0.0.3	h1:ns/ykhmWi7G9O+8a448SecJU3nSMBXJfqQkl0upE1jI=
		dep	github.com/mattn/go-runewidth	v0.0.3	h1:a+kO+98RDGEfo6asOGMmpodZq4FNtnGP54yps8BzLR4=
		dep	github.com/peterh/liner	v1.2.1	h1:O4BlKaq/LWu6VRWmol4ByWfzx6MfXc5Op5HETyIy5yg=
		dep	github.com/russross/blackfriday/v2	v2.0.1	h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q=
		dep	github.com/shurcooL/sanitized_anchor_name	v1.0.0	h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo=
		dep	github.com/sirupsen/logrus	v1.6.0	h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I=
		dep	github.com/spf13/cobra	v1.1.3	h1:xghbfqPkxzxP3C/f3n5DdpAbdKLj4ZE4BWQI362l53M=
		dep	github.com/spf13/pflag	v1.0.5	h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
		dep	go.starlark.net	v0.0.0-20200821142938-949cc6f4b097	h1:YiRMXXgG+Pg26t1fjq+iAjaauKWMC9cmGFrtOEuwDDg=
		dep	golang.org/x/arch	v0.0.0-20190927153633-4e8777c89be4	h1:QlVATYS7JBoZMVaf+cNjb90WD/beKVHnIxFKT4QaHVI=
		dep	golang.org/x/sys	v0.0.0-20211019181941-9d821ace8654	h1:id054HUawV2/6IGm2IV8KZQjqtwAOo2CYlOToYqa0d0=
		dep	gopkg.in/yaml.v2	v2.4.0	h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
	
	dlv-dap:	/Users/tekumara/go/bin/dlv-dap: go1.17.2
		path	github.com/go-delve/delve/cmd/dlv
		mod	github.com/go-delve/delve	v1.7.3-0.20211026171155-b48ceec161d5	h1:YBUOq0F2HHjVo6aeY9Y5PB69C0tSVFxxex3Ea4aTQms=
		dep	github.com/cosiner/argv	v0.1.0	h1:BVDiEL32lwHukgJKP87btEPenzrrHUjajs/8yzaqcXg=
		dep	github.com/cpuguy83/go-md2man/v2	v2.0.0	h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM=
		dep	github.com/derekparker/trie	v0.0.0-20200317170641-1fdf38b7b0e9	h1:G765iDCq7bP5opdrPkXk+4V3yfkgV9iGFuheWZ/X/zY=
		dep	github.com/google/go-dap	v0.6.0	h1:Y1RHGUtv3R8y6sXq2dtGRMYrFB2hSqyFVws7jucrzX4=
		dep	github.com/hashicorp/golang-lru	v0.5.4	h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc=
		dep	github.com/mattn/go-isatty	v0.0.3	h1:ns/ykhmWi7G9O+8a448SecJU3nSMBXJfqQkl0upE1jI=
		dep	github.com/mattn/go-runewidth	v0.0.3	h1:a+kO+98RDGEfo6asOGMmpodZq4FNtnGP54yps8BzLR4=
		dep	github.com/peterh/liner	v1.2.1	h1:O4BlKaq/LWu6VRWmol4ByWfzx6MfXc5Op5HETyIy5yg=
		dep	github.com/russross/blackfriday/v2	v2.0.1	h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q=
		dep	github.com/shurcooL/sanitized_anchor_name	v1.0.0	h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo=
		dep	github.com/sirupsen/logrus	v1.6.0	h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I=
		dep	github.com/spf13/cobra	v1.1.3	h1:xghbfqPkxzxP3C/f3n5DdpAbdKLj4ZE4BWQI362l53M=
		dep	github.com/spf13/pflag	v1.0.5	h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
		dep	go.starlark.net	v0.0.0-20200821142938-949cc6f4b097	h1:YiRMXXgG+Pg26t1fjq+iAjaauKWMC9cmGFrtOEuwDDg=
		dep	golang.org/x/arch	v0.0.0-20190927153633-4e8777c89be4	h1:QlVATYS7JBoZMVaf+cNjb90WD/beKVHnIxFKT4QaHVI=
		dep	golang.org/x/sys	v0.0.0-20210514084401-e8d321eab015	h1:hZR0X1kPW+nwyJ9xRxqZk1vx5RUObAPBdKVvXPDUH/E=
		dep	gopkg.in/yaml.v2	v2.4.0	h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
	
	staticcheck:	/Users/tekumara/go/bin/staticcheck: go1.17
		path	honnef.co/go/tools/cmd/staticcheck
		mod	honnef.co/go/tools	v0.2.1	h1:/EPr//+UMMXwMTkXvCCoaJDq8cpjMO80Ou+L4PDo2mY=
		dep	github.com/BurntSushi/toml	v0.3.1	h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
		dep	golang.org/x/mod	v0.3.0	h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4=
		dep	golang.org/x/sys	v0.0.0-20210119212857-b64e53b001e4	h1:myAQVi0cGEoqQVR5POX+8RR2mrocKqNN1hmeMqhX27k=
		dep	golang.org/x/tools	v0.1.0	h1:po9/4sTYwZU9lPhi1tOrb4hCv3qrhiQ77LZfGa2OjwY=
		dep	golang.org/x/xerrors	v0.0.0-20200804184101-5ec99f83aff1	h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
	
	gopls:	/Users/tekumara/go/bin/gopls: go1.17.2
		path	golang.org/x/tools/gopls
		mod	golang.org/x/tools/gopls	v0.7.4	h1:hw8cpqjio1iMwIKbbDkG3MeW4l8R9dY/yqOHqv7HImA=
		dep	github.com/BurntSushi/toml	v0.4.1	h1:GaI7EiDXDRfa8VshkTj7Fym7ha+y8/XxIgD2okUIjLw=
		dep	github.com/google/go-cmp	v0.5.6	h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ=
		dep	github.com/sergi/go-diff	v1.1.0	h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
		dep	golang.org/x/mod	v0.5.1	h1:OJxoQ/rynoF0dcCdI7cLPktw/hR2cueqYfjm43oqK38=
		dep	golang.org/x/sync	v0.0.0-20210220032951-036812b2e83c	h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
		dep	golang.org/x/sys	v0.0.0-20211019181941-9d821ace8654	h1:id054HUawV2/6IGm2IV8KZQjqtwAOo2CYlOToYqa0d0=
		dep	golang.org/x/text	v0.3.7	h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
		dep	golang.org/x/tools	v0.1.9-0.20211209172050-90a85b2969be	h1:JRBiPXZpZ1FsceyPRRme0vX394zXC3xlhqu705k9nzM=
		dep	golang.org/x/xerrors	v0.0.0-20200804184101-5ec99f83aff1	h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
		dep	honnef.co/go/tools	v0.2.1	h1:/EPr//+UMMXwMTkXvCCoaJDq8cpjMO80Ou+L4PDo2mY=
		dep	mvdan.cc/gofumpt	v0.1.1	h1:bi/1aS/5W00E2ny5q65w9SnKpWEF/UIOqDYBILpo9rA=
		dep	mvdan.cc/xurls/v2	v2.3.0	h1:59Olnbt67UKpxF1EwVBopJvkSUBmgtb468E4GVWIZ1I=
	

go env
Workspace Folder (modifylt): /Users/tekumara/code/modifylt
	GO111MODULE=""
	GOARCH="amd64"
	GOBIN=""
	GOCACHE="/Users/tekumara/Library/Caches/go-build"
	GOENV="/Users/tekumara/Library/Application Support/go/env"
	GOEXE=""
	GOEXPERIMENT=""
	GOFLAGS=""
	GOHOSTARCH="amd64"
	GOHOSTOS="darwin"
	GOINSECURE=""
	GOMODCACHE="/Users/tekumara/go/pkg/mod"
	GONOPROXY=""
	GONOSUMDB=""
	GOOS="darwin"
	GOPATH="/Users/tekumara/go"
	GOPRIVATE=""
	GOPROXY="https://proxy.golang.org,direct"
	GOROOT="/usr/local/Cellar/go/1.17.5/libexec"
	GOSUMDB="sum.golang.org"
	GOTMPDIR=""
	GOTOOLDIR="/usr/local/Cellar/go/1.17.5/libexec/pkg/tool/darwin_amd64"
	GOVCS=""
	GOVERSION="go1.17.5"
	GCCGO="gccgo"
	AR="ar"
	CC="clang"
	CXX="clang++"
	CGO_ENABLED="1"
	GOMOD="/Users/tekumara/code/modifylt/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 -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/00/3ln54lf50bv0bhyp38nskdhr0000gn/T/go-build1810983039=/tmp/go-build -gno-record-gcc-switches -fno-common"

Share the Go related settings you have added/edited

  "go.formatTool": "goimports",
  "go.useLanguageServer": true,
  "go.toolsManagement.autoUpdate": true,

Describe the bug

This warning pops up, even though I am able to connect and debug:

'remote' mode with 'dlv-dap' debugAdapter must connect to an external `dlv --headless` server @ v1.7.3 or later. Older versions will fail with "error layer=rpc rpc:invalid character 'C' looking for beginning of value" logged to the terminal.

This warning appeared under dlv 1.7.1. I upgraded to dlv 1.8.0 and it remained.
I expect a warning only if there is an issue that needs to be addressed.

Steps to reproduce the behavior:

  1. Start dlv debug in headless mode: dlv debug --headless --listen=:12345
  2. Create a launch config:
    {
      "name": "Connect to external session",
      "type": "go",
      "debugAdapter": "dlv-dap", // `legacy` by default
      "request": "attach",
      "mode": "remote",
      "port": 12345,
      "host": "127.0.0.1" // can skip for localhost
    }
    
  3. Add a breakpoint to the main function.
  4. Run the launch config
  5. Observe the warning popup.

Screenshots or recordings

Screen Shot 2022-01-16 at 10 01 08 am

@gopherbot gopherbot added this to the Untriaged milestone Jan 15, 2022
@hyangah
Copy link
Contributor

hyangah commented Jan 18, 2022

@tekumara Can you start the remote debug server with logging enabled (--log --log-output=rpc,dap,debugger) and share its log (of the remote debug server)?

@hyangah hyangah added Debug Issues related to the debugging functionality of the extension. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. labels Jan 18, 2022
@tekumara
Copy link
Author

No problem, here are the logs:

dlv debug --headless --listen=:12345 --log --log-output=rpc,dap,debugger
2022-01-19T09:04:53+11:00 info layer=rpc Using API v1
API server listening at: [::]:12345
2022-01-19T09:04:53+11:00 warning layer=rpc Listening for remote connections (connections are not authenticated nor encrypted)
2022-01-19T09:04:53+11:00 debug layer=rpc API server pid = 20589
2022-01-19T09:04:53+11:00 info layer=debugger launching process with args: [/Users/tekumara/code3/kubernetes/cmd/kubectl/__debug_bin]
debugserver-@(#)PROGRAM:LLDB  PROJECT:lldb-1205.0.27
 for x86_64.
Got a connection, launched process /Users/tekumara/code3/kubernetes/cmd/kubectl/__debug_bin (pid = 20651).
2022-01-19T09:05:51+11:00 debug layer=rpc serving DAP on new connection
2022-01-19T09:05:51+11:00 debug layer=dap DAP connection 1 started
2022-01-19T09:05:51+11:00 debug layer=dap [<- from client]{"seq":1,"type":"request","command":"initialize","arguments":{"clientID":"vscode","clientName":"Visual Studio Code","adapterID":"go","locale":"en-gb","linesStartAt1":true,"columnsStartAt1":true,"pathFormat":"path","supportsVariableType":true,"supportsVariablePaging":true,"supportsRunInTerminalRequest":true,"supportsMemoryReferences":true,"supportsProgressReporting":true,"supportsInvalidatedEvent":true}}
2022-01-19T09:05:51+11:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":1,"success":true,"command":"initialize","body":{"supportsConfigurationDoneRequest":true,"supportsFunctionBreakpoints":true,"supportsConditionalBreakpoints":true,"supportsEvaluateForHovers":true,"supportsSetVariable":true,"supportsExceptionInfoRequest":true,"supportTerminateDebuggee":true,"supportsDelayedStackTraceLoading":true,"supportsLogPoints":true,"supportsDisassembleRequest":true,"supportsClipboardContext":true,"supportsSteppingGranularity":true,"supportsInstructionBreakpoints":true}}
2022-01-19T09:05:51+11:00 debug layer=dap [<- from client]{"seq":2,"type":"request","command":"attach","arguments":{"name":"Connect to external session","type":"go","debugAdapter":"dlv-dap","request":"attach","mode":"remote","port":12345,"host":"127.0.0.1","__configurationTarget":5,"packagePathToGoModPathMap":{"/Users/tekumara/code3/kubernetes/vendor/k8s.io/kubectl/pkg/cmd/get":"/Users/tekumara/code3/kubernetes/staging/src/k8s.io/kubectl"},"dlvToolPath":"/Users/tekumara/go/bin/dlv-dap","env":{},"__sessionId":"7073b8b0-002c-4626-b99f-95ded6714b4c"}}
2022-01-19T09:05:51+11:00 debug layer=dap parsed launch config: {
        "mode": "remote",
        "backend": "default",
        "stackTraceDepth": 50
}
2022-01-19T09:05:51+11:00 debug layer=dap debugger already started
2022-01-19T09:05:51+11:00 debug layer=dap halting
2022-01-19T09:05:51+11:00 debug layer=dap process not running
2022-01-19T09:05:51+11:00 debug layer=dap [-> to client]{"seq":0,"type":"event","event":"initialized"}
2022-01-19T09:05:51+11:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":2,"success":true,"command":"attach"}
2022-01-19T09:05:51+11:00 debug layer=dap [<- from client]{"seq":3,"type":"request","command":"setBreakpoints","arguments":{"source":{"name":"get.go","path":"/Users/tekumara/code3/kubernetes/vendor/k8s.io/kubectl/pkg/cmd/get/get.go"},"breakpoints":[{"line":498}],"lines":[498]}}
2022-01-19T09:05:51+11:00 info layer=debugger created breakpoint: &api.Breakpoint{ID:1, Name:"sourceBp Path=\"/Users/tekumara/code3/kubernetes/vendor/k8s.io/kubectl/pkg/cmd/get/get.go\"  Line=498 Column=0", Addr:0x5d3019e, Addrs:[]uint64{0x5d3019e}, File:"/Users/tekumara/code3/kubernetes/vendor/k8s.io/kubectl/pkg/cmd/get/get.go", Line:498, FunctionName:"k8s.io/kubectl/pkg/cmd/get.(*GetOptions).Run", Cond:"", HitCond:"", Tracepoint:false, TraceReturn:false, Goroutine:false, Stacktrace:0, Variables:[]string(nil), LoadArgs:(*api.LoadConfig)(nil), LoadLocals:(*api.LoadConfig)(nil), WatchExpr:"", WatchType:0x0, VerboseDescr:[]string(nil), HitCount:map[string]uint64{}, TotalHitCount:0x0, Disabled:false, UserData:interface {}(nil)}
2022-01-19T09:05:51+11:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":3,"success":true,"command":"setBreakpoints","body":{"breakpoints":[{"id":1,"verified":true,"source":{"name":"get.go","path":"/Users/tekumara/code3/kubernetes/vendor/k8s.io/kubectl/pkg/cmd/get/get.go"},"line":498}]}}
2022-01-19T09:05:51+11:00 debug layer=dap [<- from client]{"seq":4,"type":"request","command":"setBreakpoints","arguments":{"source":{"name":"kubectl.go","path":"/Users/tekumara/code3/kubernetes/cmd/kubectl/kubectl.go"},"breakpoints":[{"line":30},{"line":32}],"lines":[30,32]}}
2022-01-19T09:05:51+11:00 info layer=debugger created breakpoint: &api.Breakpoint{ID:2, Name:"sourceBp Path=\"/Users/tekumara/code3/kubernetes/cmd/kubectl/kubectl.go\"  Line=30 Column=0", Addr:0x5fa2660, Addrs:[]uint64{0x5fa2660}, File:"/Users/tekumara/code3/kubernetes/cmd/kubectl/kubectl.go", Line:30, FunctionName:"main.main", Cond:"", HitCond:"", Tracepoint:false, TraceReturn:false, Goroutine:false, Stacktrace:0, Variables:[]string(nil), LoadArgs:(*api.LoadConfig)(nil), LoadLocals:(*api.LoadConfig)(nil), WatchExpr:"", WatchType:0x0, VerboseDescr:[]string(nil), HitCount:map[string]uint64{}, TotalHitCount:0x0, Disabled:false, UserData:interface {}(nil)}
2022-01-19T09:05:51+11:00 info layer=debugger created breakpoint: &api.Breakpoint{ID:3, Name:"sourceBp Path=\"/Users/tekumara/code3/kubernetes/cmd/kubectl/kubectl.go\"  Line=32 Column=0", Addr:0x5fa2676, Addrs:[]uint64{0x5fa2676}, File:"/Users/tekumara/code3/kubernetes/cmd/kubectl/kubectl.go", Line:32, FunctionName:"main.main", Cond:"", HitCond:"", Tracepoint:false, TraceReturn:false, Goroutine:false, Stacktrace:0, Variables:[]string(nil), LoadArgs:(*api.LoadConfig)(nil), LoadLocals:(*api.LoadConfig)(nil), WatchExpr:"", WatchType:0x0, VerboseDescr:[]string(nil), HitCount:map[string]uint64{}, TotalHitCount:0x0, Disabled:false, UserData:interface {}(nil)}
2022-01-19T09:05:51+11:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":4,"success":true,"command":"setBreakpoints","body":{"breakpoints":[{"id":2,"verified":true,"source":{"name":"kubectl.go","path":"/Users/tekumara/code3/kubernetes/cmd/kubectl/kubectl.go"},"line":30},{"id":3,"verified":true,"source":{"name":"kubectl.go","path":"/Users/tekumara/code3/kubernetes/cmd/kubectl/kubectl.go"},"line":32}]}}
2022-01-19T09:05:51+11:00 debug layer=dap [<- from client]{"seq":5,"type":"request","command":"setFunctionBreakpoints","arguments":{"breakpoints":[]}}
2022-01-19T09:05:51+11:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":5,"success":true,"command":"setFunctionBreakpoints","body":{"breakpoints":[]}}
2022-01-19T09:05:52+11:00 debug layer=dap [<- from client]{"seq":6,"type":"request","command":"setInstructionBreakpoints","arguments":{"breakpoints":[]}}
2022-01-19T09:05:52+11:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":6,"success":true,"command":"setInstructionBreakpoints","body":{"breakpoints":[]}}
2022-01-19T09:05:52+11:00 debug layer=dap [<- from client]{"seq":7,"type":"request","command":"configurationDone","arguments":{}}
2022-01-19T09:05:52+11:00 debug layer=dap [-> to client]{"seq":0,"type":"event","event":"output","body":{"category":"console","output":"Type 'dlv help' for list of commands.\n","source":{}}}
2022-01-19T09:05:52+11:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":7,"success":true,"command":"configurationDone"}
2022-01-19T09:05:52+11:00 debug layer=debugger continuing
2022-01-19T09:05:52+11:00 debug layer=dap [<- from client]{"seq":8,"type":"request","command":"threads"}
2022-01-19T09:05:52+11:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":8,"success":true,"command":"threads","body":{"threads":[{"id":-1,"name":"Current"}]}}
2022-01-19T09:05:52+11:00 debug layer=dap "continue" command stopped - reason "breakpoint", location /Users/tekumara/code3/kubernetes/cmd/kubectl/kubectl.go:30
2022-01-19T09:05:52+11:00 debug layer=dap [-> to client]{"seq":0,"type":"event","event":"stopped","body":{"reason":"breakpoint","threadId":1,"allThreadsStopped":true,"hitBreakpointIds":[2]}}
2022-01-19T09:05:52+11:00 debug layer=dap [<- from client]{"seq":9,"type":"request","command":"threads"}
2022-01-19T09:05:52+11:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":9,"success":true,"command":"threads","body":{"threads":[{"id":1,"name":"* [Go 1] main.main (Thread 201291)"},{"id":2,"name":"[Go 2] runtime.gopark"},{"id":18,"name":"[Go 18] runtime.gopark"},{"id":19,"name":"[Go 19] runtime.gopark"},{"id":3,"name":"[Go 3] runtime.gopark"},{"id":4,"name":"[Go 4] k8s.io/klog/v2.(*loggingT).flushDaemon"},{"id":5,"name":"[Go 5] runtime.gopark"},{"id":34,"name":"[Go 34] runtime.gopark"},{"id":6,"name":"[Go 6] runtime.gopark"},{"id":7,"name":"[Go 7] runtime.gopark"},{"id":35,"name":"[Go 35] runtime.gopark"},{"id":8,"name":"[Go 8] runtime.gopark"},{"id":20,"name":"[Go 20] runtime.gopark"},{"id":21,"name":"[Go 21] runtime.gopark"},{"id":9,"name":"[Go 9] runtime.gopark"},{"id":36,"name":"[Go 36] runtime.gopark"},{"id":22,"name":"[Go 22] runtime.gopark"},{"id":23,"name":"[Go 23] runtime.gopark"}]}}
2022-01-19T09:05:52+11:00 debug layer=dap [<- from client]{"seq":10,"type":"request","command":"stackTrace","arguments":{"threadId":1,"levels":1,"format":{}}}
2022-01-19T09:05:52+11:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":10,"success":true,"command":"stackTrace","body":{"stackFrames":[{"id":1000,"name":"main.main","source":{"name":"kubectl.go","path":"/Users/tekumara/code3/kubernetes/cmd/kubectl/kubectl.go"},"line":30,"column":0,"instructionPointerReference":"0x5fa2660"}],"totalFrames":51}}
2022-01-19T09:05:52+11:00 debug layer=dap [<- from client]{"seq":11,"type":"request","command":"stackTrace","arguments":{"threadId":1,"startFrame":1,"levels":19,"format":{}}}
2022-01-19T09:05:52+11:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":11,"success":true,"command":"stackTrace","body":{"stackFrames":[{"id":1001,"name":"runtime.main","source":{"name":"proc.go","path":"/usr/local/Cellar/go/1.17.5/libexec/src/runtime/proc.go"},"line":255,"column":0,"instructionPointerReference":"0x403f293","presentationHint":"subtle"},{"id":1002,"name":"runtime.goexit","source":{"name":"asm_amd64.s","path":"/usr/local/Cellar/go/1.17.5/libexec/src/runtime/asm_amd64.s"},"line":1581,"column":0,"instructionPointerReference":"0x40704e1","presentationHint":"subtle"}],"totalFrames":3}}
2022-01-19T09:05:52+11:00 debug layer=dap [<- from client]{"seq":12,"type":"request","command":"scopes","arguments":{"frameId":1000}}
2022-01-19T09:05:52+11:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":12,"success":true,"command":"scopes","body":{"scopes":[{"name":"Locals","variablesReference":1000,"expensive":false,"source":{}}]}}
2022-01-19T09:05:52+11:00 debug layer=dap [<- from client]{"seq":13,"type":"request","command":"variables","arguments":{"variablesReference":1000,"format":{}}}
2022-01-19T09:05:52+11:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":13,"success":true,"command":"variables","body":{"variables":[{"name":"command","value":"*github.com/spf13/cobra.Command {Use: \"kubectl\", Aliases: []string len: 0, cap: 0, nil, SuggestFor: []string len: 0, cap: 0, nil, Short: \"kubectl controls the Kubernetes cluster manager\", Long: \"kubectl controls the Kubernetes cluster manager.\\n\\n Find mor...","type":"*github.com/spf13/cobra.Command","presentationHint":{},"evaluateName":"command","variablesReference":1001}]}}

@hyangah
Copy link
Contributor

hyangah commented Jan 19, 2022

Thanks @tekumara
The log shows debugging works (breakpoint worked, threads/stackTrace/variables requests succeeded, ... ), but the extension still showed this incorrect popup spuriously. Does it match your observation?

cc @polinasok @suzmue

@tekumara
Copy link
Author

Yep - debugging works but the popup is spurious.

@polinasok
Copy link
Contributor

This pop-up is not an error. It is informational and was designed to let the users know that they were switching to using dlv-dap for remote, which was previously always using legacy. We don't have a way to tell what version the remote server is, so this was triggered in all cases just in case the user stumbled into the dlv-dap remote mode by accident. The idea was that once the user confirms their set-up, they could just disable with "Don't Show Again" and never see this again.

@polinasok
Copy link
Contributor

Sorry, posted before I was done typing. We realized that this could be confusing and interpreted as an error, so we tweaked the wording - see #1945 (comment), but this unfortunately didn't make it into the current release. Our plan was to remove the start-up warning once the user community was aware of the dlv-dap remote mode.

@hyangah
Copy link
Contributor

hyangah commented Jan 19, 2022

@polinasok I suspect there is a bug that caused this popup show (maybe a race?) even when the remote debugging using dlv-dap was successful.

Edit: Oh, I see. I think this popup is distracting and should use Information (not Warning) if we want to keep this.

@polinasok
Copy link
Contributor

@hyangah No, there is no race, this always shows up on start-up and is working as intended. With nighlty it would still show up, but will be less confusingly worded. Please see #1945. We were in the middle of deciding whether to take it out completely in case users get confused and think it is an error (like they did here), but then the extension got released as-is, and this topic got dropped.

@polinasok
Copy link
Contributor

Edit: Oh, I see. I think this popup is distracting and should use Information (not Warning) if we want to keep this.

We had that discussion too: https://go-review.googlesource.com/c/vscode-go/+/371974/1/src/goDebugConfiguration.ts#178
I think at this point, we might as well take this out completely since there is now another pop-up when the session fails.

@polinasok polinasok added NeedsFix The path to resolution is known, but the work has not been done. and removed WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. labels Jan 19, 2022
@polinasok polinasok reopened this Jan 19, 2022
@hyangah hyangah modified the milestones: Untriaged, v0.33.0 Jan 28, 2022
@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/391054 mentions this issue: src/goDebugConfiguration: remove remote attach info pop-up

@hyangah hyangah mentioned this issue Apr 26, 2022
25 tasks
@golang golang locked and limited conversation to collaborators Mar 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Debug Issues related to the debugging functionality of the extension. FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants