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

vscode remote debug failed: could not find file #3858

Open
wangzhankun opened this issue Nov 11, 2024 · 5 comments
Open

vscode remote debug failed: could not find file #3858

wangzhankun opened this issue Nov 11, 2024 · 5 comments

Comments

@wangzhankun
Copy link

dev env

  • Delve Debugger Version: 1.23.1
  • go version go1.22.7 linux/amd64
  • client os: macos
  • remote os: debian10

The code is in remote os, and the path is to home is a symlink. I have set substitutePath in vscode to convert the HOME path to the correct path. Debugger works fine when set breakpoint to the code in the ${workspacefolder}, but failed to set breakpoint to the go library files debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":21,"success":true,"command":"setBreakpoints","body":{"breakpoints":[{"verified":false,"message":"could not find file /data00/home/wangzhankun/go/pkg/mod/k8s.io/[email protected]/pkg/cmd/logs/logs.go"}]}}

{
    "go.delveConfig": {
        "showLog": true,
        "logOutput": "dap",
        "substitutePath": [{"from": "/home/wangzhankun", "to": "/data00/home/wangzhankun"}]
    },
    "debugpy.debugJustMyCode": false
}

full log

Starting: /home/wangzhankun/go/bin/dlv dap --log=true --log-output=dap --listen=127.0.0.1:18407 --log-dest=3 from /home/wangzhankun/documents/work-at-bytedance/coredns-helper/pkg/kubectl_proxy
DAP server listening at: 127.0.0.1:18407
2024-11-11T14:26:01+08:00 debug layer=dap DAP server pid = 2892225
2024-11-11T14:26:01+08:00 debug layer=dap DAP connection 1 started
2024-11-11T14:26:01+08:00 debug layer=dap [<- from client]{"seq":1,"type":"request","command":"initialize","arguments":{"clientID":"vscode","clientName":"Visual Studio Code","adapterID":"go","locale":"zh-cn","linesStartAt1":true,"columnsStartAt1":true,"pathFormat":"path","supportsVariableType":true,"supportsVariablePaging":true,"supportsRunInTerminalRequest":true,"supportsMemoryReferences":true,"supportsProgressReporting":true,"supportsInvalidatedEvent":true,"supportsMemoryEvent":true,"supportsArgsCanBeInterpretedByShell":true,"supportsStartDebuggingRequest":true}}
2024-11-11T14:26:01+08: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,"supportsDelayedStackTraceLoading":true,"supportsLogPoints":true,"supportsDisassembleRequest":true,"supportsClipboardContext":true,"supportsSteppingGranularity":true,"supportsInstructionBreakpoints":true}}
2024-11-11T14:26:01+08:00 debug layer=dap [<- from client]{"seq":2,"type":"request","command":"launch","arguments":{"name":"Debug Test","type":"go","request":"launch","mode":"test","program":".","env":{"GOPATH":"/home/wangzhankun/go"},"args":["-test.run","^TestKubectlLogsCommand$"],"buildFlags":"","packagePathToGoModPathMap":{"/home/wangzhankun/documents/work-at-bytedance/coredns-helper/pkg/kubectl_proxy":"/data00/home/wangzhankun/documents/work-at-bytedance/coredns-helper"},"debugAdapter":"dlv-dap","showRegisters":false,"showGlobalVariables":false,"substitutePath":[{"from":"/home/wangzhankun","to":"/data00/home/wangzhankun"}],"showLog":true,"logOutput":"dap","dlvFlags":[],"hideSystemGoroutines":false,"dlvToolPath":"/home/wangzhankun/go/bin/dlv","__buildDir":"/home/wangzhankun/documents/work-at-bytedance/coredns-helper/pkg/kubectl_proxy","__sessionId":"36c76f4b-c421-4d1d-93a3-7c4794c42fde"}}
2024-11-11T14:26:01+08:00 debug layer=dap parsed launch config: {
	"mode": "test",
	"program": ".",
	"args": [
		"-test.run",
		"^TestKubectlLogsCommand$"
	],
	"buildFlags": {},
	"env": {
		"GOPATH": "/home/wangzhankun/go"
	},
	"backend": "default",
	"stackTraceDepth": 50,
	"substitutePath": [
		{
			"from": "/home/wangzhankun",
			"to": "/data00/home/wangzhankun"
		}
	]
}
2024-11-11T14:26:06+08:00 debug layer=dap building from "/data00/home/wangzhankun/documents/work-at-bytedance/coredns-helper/pkg/kubectl_proxy": [go test -c -o /data00/home/wangzhankun/documents/work-at-bytedance/coredns-helper/pkg/kubectl_proxy/__debug_bin760007768 -gcflags all=-N -l .]
2024-11-11T14:26:06+08:00 debug layer=dap launching binary '/data00/home/wangzhankun/documents/work-at-bytedance/coredns-helper/pkg/kubectl_proxy/__debug_bin760007768' with config: {
	"mode": "test",
	"program": "/data00/home/wangzhankun/documents/work-at-bytedance/coredns-helper/pkg/kubectl_proxy",
	"args": [
		"-test.run",
		"^TestKubectlLogsCommand$"
	],
	"cwd": "/data00/home/wangzhankun/documents/work-at-bytedance/coredns-helper/pkg/kubectl_proxy",
	"buildFlags": {},
	"output": "/data00/home/wangzhankun/documents/work-at-bytedance/coredns-helper/pkg/kubectl_proxy/__debug_bin760007768",
	"dlvCwd": "/data00/home/wangzhankun/documents/work-at-bytedance/coredns-helper/pkg/kubectl_proxy",
	"env": {
		"GOPATH": "/home/wangzhankun/go"
	},
	"backend": "default",
	"stackTraceDepth": 50,
	"substitutePath": [
		{
			"from": "/home/wangzhankun",
			"to": "/data00/home/wangzhankun"
		}
	]
}
2024-11-11T14:26:07+08:00 debug layer=dap [-> to client]{"seq":0,"type":"event","event":"initialized"}
2024-11-11T14:26:07+08:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":2,"success":true,"command":"launch"}
2024-11-11T14:26:07+08:00 debug layer=dap [<- from client]{"seq":3,"type":"request","command":"setBreakpoints","arguments":{"source":{"name":"logs.go","path":"/home/wangzhankun/go/pkg/mod/k8s.io/[email protected]/pkg/cmd/logs/logs.go"},"breakpoints":[{"line":344}],"lines":[344]}}
2024-11-11T14:26:07+08:00 debug layer=dap client path=/home/wangzhankun/go/pkg/mod/k8s.io/[email protected]/pkg/cmd/logs/logs.go converted to server path=/data00/home/wangzhankun/go/pkg/mod/k8s.io/[email protected]/pkg/cmd/logs/logs.go
2024-11-11T14:26:07+08:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":3,"success":true,"command":"setBreakpoints","body":{"breakpoints":[{"verified":false,"message":"could not find file /data00/home/wangzhankun/go/pkg/mod/k8s.io/[email protected]/pkg/cmd/logs/logs.go"}]}}
2024-11-11T14:26:07+08:00 debug layer=dap [<- from client]{"seq":4,"type":"request","command":"setBreakpoints","arguments":{"source":{"name":"logs.go","path":"/home/wangzhankun/documents/work-at-bytedance/coredns-helper/pkg/k8sresource/logs.go"},"breakpoints":[{"line":100},{"line":101}],"lines":[100,101]}}
2024-11-11T14:26:07+08:00 debug layer=dap client path=/home/wangzhankun/documents/work-at-bytedance/coredns-helper/pkg/k8sresource/logs.go converted to server path=/data00/home/wangzhankun/documents/work-at-bytedance/coredns-helper/pkg/k8sresource/logs.go
2024-11-11T14:26:07+08:00 debug layer=dap server path=/data00/home/wangzhankun/documents/work-at-bytedance/coredns-helper/pkg/k8sresource/logs.go converted to client path=/home/wangzhankun/documents/work-at-bytedance/coredns-helper/pkg/k8sresource/logs.go

2024-11-11T14:26:07+08:00 debug layer=dap server path=/data00/home/wangzhankun/documents/work-at-bytedance/coredns-helper/pkg/k8sresource/logs.go converted to client path=/home/wangzhankun/documents/work-at-bytedance/coredns-helper/pkg/k8sresource/logs.go
2024-11-11T14:26:07+08: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":"logs.go","path":"/home/wangzhankun/documents/work-at-bytedance/coredns-helper/pkg/k8sresource/logs.go"},"line":100},{"id":3,"verified":true,"source":{"name":"logs.go","path":"/home/wangzhankun/documents/work-at-bytedance/coredns-helper/pkg/k8sresource/logs.go"},"line":101}]}}
2024-11-11T14:26:07+08:00 debug layer=dap [<- from client]{"seq":5,"type":"request","command":"setBreakpoints","arguments":{"source":{"name":"rest_client.go","path":"/home/wangzhankun/documents/work-at-bytedance/coredns-helper/pkg/k8sclient/rest_client.go"},"breakpoints":[{"line":121}],"lines":[121]}}
2024-11-11T14:26:07+08:00 debug layer=dap client path=/home/wangzhankun/documents/work-at-bytedance/coredns-helper/pkg/k8sclient/rest_client.go converted to server path=/data00/home/wangzhankun/documents/work-at-bytedance/coredns-helper/pkg/k8sclient/rest_client.go
2024-11-11T14:26:07+08:00 debug layer=dap server path=/data00/home/wangzhankun/documents/work-at-bytedance/coredns-helper/pkg/k8sclient/rest_client.go converted to client path=/home/wangzhankun/documents/work-at-bytedance/coredns-helper/pkg/k8sclient/rest_client.go

2024-11-11T14:26:07+08:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":5,"success":true,"command":"setBreakpoints","body":{"breakpoints":[{"id":4,"verified":true,"source":{"name":"rest_client.go","path":"/home/wangzhankun/documents/work-at-bytedance/coredns-helper/pkg/k8sclient/rest_client.go"},"line":121}]}}
2024-11-11T14:26:07+08:00 debug layer=dap [<- from client]{"seq":6,"type":"request","command":"setFunctionBreakpoints","arguments":{"breakpoints":[]}}
2024-11-11T14:26:07+08:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":6,"success":true,"command":"setFunctionBreakpoints","body":{"breakpoints":[]}}
2024-11-11T14:26:07+08:00 debug layer=dap [<- from client]{"seq":7,"type":"request","command":"setInstructionBreakpoints","arguments":{"breakpoints":[]}}
2024-11-11T14:26:07+08:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":7,"success":true,"command":"setInstructionBreakpoints","body":{"breakpoints":[]}}
2024-11-11T14:26:07+08:00 debug layer=dap [<- from client]{"seq":8,"type":"request","command":"configurationDone"}
2024-11-11T14:26:07+08:00 debug layer=dap [-> to client]{"seq":0,"type":"event","event":"output","body":{"category":"console","output":"Type 'dlv help' for list of commands.\n"}}
Type 'dlv help' for list of commands.
2024-11-11T14:26:07+08:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":8,"success":true,"command":"configurationDone"}
2024-11-11T14:26:07+08:00 debug layer=dap [<- from client]{"seq":9,"type":"request","command":"threads"}
2024-11-11T14:26:07+08:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":9,"success":true,"command":"threads","body":{"threads":[{"id":-1,"name":"Current"}]}}
2024-11-11T14:26:08+08:00 debug layer=dap "continue" command stopped - reason "breakpoint", location /data00/home/wangzhankun/documents/work-at-bytedance/coredns-helper/pkg/k8sresource/logs.go:100
2024-11-11T14:26:08+08:00 debug layer=dap [-> to client]{"seq":0,"type":"event","event":"stopped","body":{"reason":"breakpoint","threadId":15,"allThreadsStopped":true,"hitBreakpointIds":[2]}}
2024-11-11T14:26:08+08:00 debug layer=dap [<- from client]{"seq":10,"type":"request","command":"threads"}
2024-11-11T14:26:08+08:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":10,"success":true,"command":"threads","body":{"threads":[{"id":1,"name":"[Go 1] testing.(*T).Run"},{"id":2,"name":"[Go 2] runtime.gopark"},{"id":3,"name":"[Go 3] runtime.gopark"},{"id":4,"name":"[Go 4] runtime.gopark"},{"id":5,"name":"[Go 5] runtime.gopark"},{"id":6,"name":"[Go 6] klog.(*loggingT).flushDaemon"},{"id":7,"name":"[Go 7] runtime.gopark"},{"id":18,"name":"[Go 18] runtime.gopark"},{"id":34,"name":"[Go 34] runtime.gopark"},{"id":8,"name":"[Go 8] runtime.gopark"},{"id":35,"name":"[Go 35] runtime.gopark"},{"id":9,"name":"[Go 9] runtime.gopark"},{"id":36,"name":"[Go 36] runtime.gopark"},{"id":10,"name":"[Go 10] runtime.gopark"},{"id":37,"name":"[Go 37] runtime.gopark"},{"id":11,"name":"[Go 11] runtime.gopark"},{"id":38,"name":"[Go 38] runtime.gopark"},{"id":12,"name":"[Go 12] runtime.gopark"},{"id":39,"name":"[Go 39] runtime.gopark"},{"id":19,"name":"[Go 19] runtime.gopark"},{"id":13,"name":"[Go 13] runtime.gopark"},{"id":20,"name":"[Go 20] runtime.gopark"},{"id":14,"name":"[Go 14] testing.(*T).Run"},{"id":15,"name":"* [Go 15] k8sresource.NewCmdLogs.func1 (Thread 2892521)"},{"id":16,"name":"[Go 16] go-cache.(*janitor).Run"},{"id":50,"name":"[Go 50] go-cache.(*janitor).Run"},{"id":51,"name":"[Go 51] go-cache.(*janitor).Run"}]}}
2024-11-11T14:26:08+08:00 debug layer=dap [<- from client]{"seq":11,"type":"request","command":"stackTrace","arguments":{"threadId":15,"levels":1}}
2024-11-11T14:26:08+08:00 debug layer=dap server path=/data00/home/wangzhankun/documents/work-at-bytedance/coredns-helper/pkg/k8sresource/logs.go converted to client path=/home/wangzhankun/documents/work-at-bytedance/coredns-helper/pkg/k8sresource/logs.go
2024-11-11T14:26:08+08:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":11,"success":true,"command":"stackTrace","body":{"stackFrames":[{"id":1000,"name":"k8sresource.NewCmdLogs.func1","source":{"name":"logs.go","path":"/home/wangzhankun/documents/work-at-bytedance/coredns-helper/pkg/k8sresource/logs.go"},"line":100,"column":0,"instructionPointerReference":"0x381c698"}],"totalFrames":51}}
2024-11-11T14:26:09+08:00 debug layer=dap [<- from client]{"seq":12,"type":"request","command":"stackTrace","arguments":{"threadId":15,"startFrame":1,"levels":19}}
2024-11-11T14:26:09+08:00 debug layer=dap server path=/data00/home/wangzhankun/documents/work-at-bytedance/coredns-helper/pkg/kubectl_proxy/rootcmd_test.go converted to client path=/home/wangzhankun/documents/work-at-bytedance/coredns-helper/pkg/kubectl_proxy/rootcmd_test.go

2024-11-11T14:26:09+08:00 debug layer=dap server path=/data00/home/wangzhankun/documents/work-at-bytedance/coredns-helper/pkg/kubectl_proxy/rootcmd_test.go converted to client path=/home/wangzhankun/documents/work-at-bytedance/coredns-helper/pkg/kubectl_proxy/rootcmd_test.go
2024-11-11T14:26:09+08:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":12,"success":true,"command":"stackTrace","body":{"stackFrames":[{"id":1001,"name":"cobra.(*Command).execute","source":{"name":"command.go","path":"/home/wangzhankun/go/pkg/mod/github.com/spf13/[email protected]/command.go"},"line":989,"column":0,"instructionPointerReference":"0x2fb0c08"},{"id":1002,"name":"cobra.(*Command).ExecuteC","source":{"name":"command.go","path":"/home/wangzhankun/go/pkg/mod/github.com/spf13/[email protected]/command.go"},"line":1117,"column":0,"instructionPointerReference":"0x2fb1c90"},{"id":1003,"name":"cobra.(*Command).Execute","source":{"name":"command.go","path":"/home/wangzhankun/go/pkg/mod/github.com/spf13/[email protected]/command.go"},"line":1041,"column":0,"instructionPointerReference":"0x2fb1132"},{"id":1004,"name":"kubectl_proxy.doTest","source":{"name":"rootcmd_test.go","path":"/home/wangzhankun/documents/work-at-bytedance/coredns-helper/pkg/kubectl_proxy/rootcmd_test.go"},"line":213,"column":0,"instructionPointerReference":"0x386b60f"},{"id":1005,"name":"kubectl_proxy.doTests.func1","source":{"name":"rootcmd_test.go","path":"/home/wangzhankun/documents/work-at-bytedance/coredns-helper/pkg/kubectl_proxy/rootcmd_test.go"},"line":193,"column":0,"instructionPointerReference":"0x386b23a"},{"id":1006,"name":"testing.tRunner","source":{"name":"testing.go","path":"/usr/local/go/src/testing/testing.go"},"line":1689,"column":0,"instructionPointerReference":"0x1290f1a"},{"id":1007,"name":"testing.(*T).Run.gowrap1","source":{"name":"testing.go","path":"/usr/local/go/src/testing/testing.go"},"line":1742,"column":0,"instructionPointerReference":"0x1292c13"},{"id":1008,"name":"runtime.goexit","source":{"name":"asm_amd64.s","path":"/usr/local/go/src/runtime/asm_amd64.s"},"line":1695,"column":0,"instructionPointerReference":"0x111c5e1","presentationHint":"subtle"}],"totalFrames":9}}
2024-11-11T14:26:09+08:00 debug layer=dap [<- from client]{"seq":13,"type":"request","command":"scopes","arguments":{"frameId":1000}}
2024-11-11T14:26:09+08:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":13,"success":true,"command":"scopes","body":{"scopes":[{"name":"Locals","variablesReference":1000,"expensive":false}]}}
2024-11-11T14:26:09+08:00 debug layer=dap [<- from client]{"seq":14,"type":"request","command":"variables","arguments":{"variablesReference":1000}}
2024-11-11T14:26:09+08:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":14,"success":true,"command":"variables","body":{"variables":[{"name":"cmd","value":"*cobra.Command {Use: \"logs [-f] [-p] (POD | TYPE/NAME) [-c CONTAINER]\", Aliases: []string len: 0, cap: 0, nil, SuggestFor: []string len: 0, cap: 0, nil, Short: \"Print the logs for a container in a pod\", GroupID: \"\", Long: \"Print the logs for a container in...","type":"*github.com/spf13/cobra.Command","evaluateName":"cmd","variablesReference":1001},{"name":"args","value":"[]string len: 1, cap: 3, [\"coredns-5b7674697-8dh2f\"]","type":"[]string","evaluateName":"args","variablesReference":1002,"indexedVariables":1},{"name":"f","value":"util.Factory(*k8s.io/kubectl/pkg/cmd/testing.TestFactory) *{Factory: k8s.io/kubectl/pkg/cmd/util.Factory(*k8s.io/kubectl/pkg/cmd/util.factoryImpl) *{clientGetter: k8s.io/cli-runtime/pkg/genericclioptions.RESTClientGetter(*k8s.io/cli-runtime/pkg/genericclio...","type":"k8s.io/kubectl/pkg/cmd/util.Factory(*k8s.io/kubectl/pkg/cmd/testing.TestFactory)","evaluateName":"f","variablesReference":1003},{"name":"o","value":"*logs.LogsOptions {Namespace: \"\", ResourceArg: \"\", AllContainers: false, AllPods: false, Options: k8s.io/apimachinery/pkg/runtime.Object nil, Resources: []string len: 0, cap: 0, nil, ConsumeRequestFn: nil, SinceTime: \"\", SinceSeconds: github.com/patrickmn/...","type":"*k8s.io/kubectl/pkg/cmd/logs.LogsOptions","evaluateName":"o","variablesReference":1004},{"name":"ns","value":"\"kube-system\"","type":"string","evaluateName":"ns","variablesReference":0}]}}
2024-11-11T14:26:55+08:00 debug layer=dap [<- from client]{"seq":15,"type":"request","command":"evaluate","arguments":{"expression":"o.Complete","frameId":1000,"context":"hover"}}
2024-11-11T14:26:55+08:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":15,"success":true,"command":"evaluate","body":{"result":"k8s.io/kubectl/pkg/cmd/logs.(*LogsOptions).Complete","type":"func(f k8s.io/kubectl/pkg/cmd/util.Factory, cmd *github.com/spf13/cobra.Command, args []string) error","variablesReference":1005}}
2024-11-11T14:26:55+08:00 debug layer=dap [<- from client]{"seq":16,"type":"request","command":"variables","arguments":{"variablesReference":1005}}
2024-11-11T14:26:55+08:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":16,"success":true,"command":"variables","body":{"variables":[{"name":"o","value":"nil","type":"*k8s.io/kubectl/pkg/cmd/logs.LogsOptions","evaluateName":"(o.Complete).o","variablesReference":0}]}}
2024-11-11T14:26:59+08:00 debug layer=dap [<- from client]{"seq":17,"type":"request","command":"setBreakpoints","arguments":{"source":{"name":"logs.go","path":"/home/wangzhankun/go/pkg/mod/k8s.io/[email protected]/pkg/cmd/logs/logs.go"},"breakpoints":[{"line":344},{"line":229}],"lines":[344,229]}}
2024-11-11T14:26:59+08:00 debug layer=dap client path=/home/wangzhankun/go/pkg/mod/k8s.io/[email protected]/pkg/cmd/logs/logs.go converted to server path=/data00/home/wangzhankun/go/pkg/mod/k8s.io/[email protected]/pkg/cmd/logs/logs.go
2024-11-11T14:26:59+08:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":17,"success":true,"command":"setBreakpoints","body":{"breakpoints":[{"verified":false,"message":"could not find file /data00/home/wangzhankun/go/pkg/mod/k8s.io/[email protected]/pkg/cmd/logs/logs.go"},{"verified":false,"message":"could not find file /data00/home/wangzhankun/go/pkg/mod/k8s.io/[email protected]/pkg/cmd/logs/logs.go"}]}}
dlv help
2024-11-11T14:28:05+08:00 debug layer=dap [<- from client]{"seq":18,"type":"request","command":"evaluate","arguments":{"expression":"dlv help","frameId":1000,"context":"repl"}}
2024-11-11T14:28:05+08:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":18,"success":true,"command":"evaluate","body":{"result":"The following commands are available:\n    dlv help (alias: h) \t Prints the help message.\n    dlv config \t Changes configuration parameters.\n    dlv sources (alias: s) \t Print list of source files.\n\nType 'dlv help' followed by a command for full documentation.\n","variablesReference":0}}
The following commands are available:
    dlv help (alias: h) 	 Prints the help message.
    dlv config 	 Changes configuration parameters.
    dlv sources (alias: s) 	 Print list of source files.

Type 'dlv help' followed by a command for full documentation.
2024-11-11T14:28:05+08:00 debug layer=dap [<- from client]{"seq":19,"type":"request","command":"scopes","arguments":{"frameId":1000}}
2024-11-11T14:28:05+08:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":19,"success":true,"command":"scopes","body":{"scopes":[{"name":"Locals","variablesReference":1006,"expensive":false}]}}
2024-11-11T14:28:05+08:00 debug layer=dap [<- from client]{"seq":20,"type":"request","command":"variables","arguments":{"variablesReference":1006}}
2024-11-11T14:28:05+08:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":20,"success":true,"command":"variables","body":{"variables":[{"name":"cmd","value":"*cobra.Command {Use: \"logs [-f] [-p] (POD | TYPE/NAME) [-c CONTAINER]\", Aliases: []string len: 0, cap: 0, nil, SuggestFor: []string len: 0, cap: 0, nil, Short: \"Print the logs for a container in a pod\", GroupID: \"\", Long: \"Print the logs for a container in...","type":"*github.com/spf13/cobra.Command","evaluateName":"cmd","variablesReference":1007},{"name":"args","value":"[]string len: 1, cap: 3, [\"coredns-5b7674697-8dh2f\"]","type":"[]string","evaluateName":"args","variablesReference":1008,"indexedVariables":1},{"name":"f","value":"util.Factory(*k8s.io/kubectl/pkg/cmd/testing.TestFactory) *{Factory: k8s.io/kubectl/pkg/cmd/util.Factory(*k8s.io/kubectl/pkg/cmd/util.factoryImpl) *{clientGetter: k8s.io/cli-runtime/pkg/genericclioptions.RESTClientGetter(*k8s.io/cli-runtime/pkg/genericclio...","type":"k8s.io/kubectl/pkg/cmd/util.Factory(*k8s.io/kubectl/pkg/cmd/testing.TestFactory)","evaluateName":"f","variablesReference":1009},{"name":"o","value":"*logs.LogsOptions {Namespace: \"\", ResourceArg: \"\", AllContainers: false, AllPods: false, Options: k8s.io/apimachinery/pkg/runtime.Object nil, Resources: []string len: 0, cap: 0, nil, ConsumeRequestFn: nil, SinceTime: \"\", SinceSeconds: github.com/patrickmn/...","type":"*k8s.io/kubectl/pkg/cmd/logs.LogsOptions","evaluateName":"o","variablesReference":1010},{"name":"ns","value":"\"kube-system\"","type":"string","evaluateName":"ns","variablesReference":0}]}}
2024-11-11T14:30:06+08:00 debug layer=dap [<- from client]{"seq":21,"type":"request","command":"setBreakpoints","arguments":{"source":{"name":"logs.go","path":"/home/wangzhankun/go/pkg/mod/k8s.io/[email protected]/pkg/cmd/logs/logs.go"},"breakpoints":[{"line":229}],"lines":[229]}}
2024-11-11T14:30:06+08:00 debug layer=dap client path=/home/wangzhankun/go/pkg/mod/k8s.io/[email protected]/pkg/cmd/logs/logs.go converted to server path=/data00/home/wangzhankun/go/pkg/mod/k8s.io/[email protected]/pkg/cmd/logs/logs.go
2024-11-11T14:30:06+08:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":21,"success":true,"command":"setBreakpoints","body":{"breakpoints":[{"verified":false,"message":"could not find file /data00/home/wangzhankun/go/pkg/mod/k8s.io/[email protected]/pkg/cmd/logs/logs.go"}]}}
2024-11-11T14:39:48+08:00 debug layer=dap [<- from client]{"seq":22,"type":"request","command":"disconnect","arguments":{}}
2024-11-11T14:39:48+08:00 debug layer=dap halting
2024-11-11T14:39:48+08:00 debug layer=dap process not running
2024-11-11T14:39:48+08:00 debug layer=dap [-> to client]{"seq":0,"type":"event","event":"output","body":{"category":"console","output":"Detaching and terminating target process\n"}}
Detaching and terminating target process
2024-11-11T14:39:48+08:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":22,"success":true,"command":"disconnect"}
2024-11-11T14:39:48+08:00 debug layer=dap [-> to client]{"seq":0,"type":"event","event":"terminated","body":{}}
2024-11-11T14:39:48+08:00 debug layer=dap DAP server stopping...
2024-11-11T14:39:48+08:00 debug layer=dap DAP server stopped
dlv dap (2892225) exited with code: 0
@aarzilli
Copy link
Member

aarzilli commented Nov 11, 2024 via email

@wangzhankun
Copy link
Author

wangzhankun commented Nov 13, 2024

I'm sure the modules directory is located at /home/wangzhankun/go/pkg, I have set substitutePath, and it works for $workspacefolder, but failed to change modules dir. @aarzilli

"substitutePath": [
		{
			"from": "/home/wangzhankun",
			"to": "/data00/home/wangzhankun"
		}
	]

@aarzilli
Copy link
Member

I'm sure the modules directory is located at /home/wangzhankun/go/pkg, I have set substitutePath, and it works for $workspacefolder, but failed to change modules dir. @aarzilli

But are you sure that it is also at /data00/wangzhankun/go/pkg? Have you checked the list of source files in the executable?

@wangzhankun
Copy link
Author

of course pkg is at /data00/wangzhankun/go/pkg
image

@aarzilli
Copy link
Member

You should check what source files are actually in the executable by evaluating dlv sources kubectl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants