Remote debugging - Unverified breakpoint

前端 未结 2 867
鱼传尺愫
鱼传尺愫 2021-01-14 12:54

Hope I can explain this right.

Update: I can confirm that dlv debug -l 127.0.0.1:2345 does work. Therefore I must be in VsCode launch.json

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-14 13:44

    I figured out my problem by adding the "trace" option to the launch.json (in VS Code)

        {
            "name": "Attach remote ",
            "type": "go",
            "request": "attach",
            "mode": "remote",
            "remotePath": "/home/me/goprojects/src/github.com/owner/project/package",
            "port": 2345,
            "host": "xxxx.xyz",
            "trace":"log",
    
        }
    

    Doing that revealed in the Debug Console that it was looking for the source file with the wrong path. I realised that remotePath in the launch.json should be (for my setup at least) just /home/me/goprojects/src/github.com/owner/project

    So, try adding trace and scrutinize the Debug Console

提交回复
热议问题