首页 > 其他分享 >vscode-go语言插件,调试器协议分析

vscode-go语言插件,调试器协议分析

时间:2023-12-07 10:58:47浏览次数:30  
标签:插件 name seq vscode request -- command type 调试器


c 客户端, vscode
s 服务端, 调试器 
----------------------------------------------
c--> 客户端,请求调试器初始化
{
    "command": "initialize",
    "arguments": {
        "clientID": "vscode",
        "clientName": "Visual Studio Code",
        "adapterID": "go",
        "pathFormat": "path",
        "linesStartAt1": true,
        "columnsStartAt1": true,
        "supportsVariableType": true,
        "supportsVariablePaging": true,
        "supportsRunInTerminalRequest": true,
        "locale": "zh-cn",
        "supportsProgressReporting": true,
        "supportsInvalidatedEvent": true,
        "supportsMemoryReferences": true,
        "supportsArgsCanBeInterpretedByShell": true,
        "supportsMemoryEvent": true,
        "supportsStartDebuggingRequest": true
    },
    "type": "request",
    "seq": 1
}

s--> 调试器,输出
{
    "seq": 0,
    "type": "event",
    "event": "output",
    "body": {
        "category": "console",
        "output": "Starting: /data/repo/golang/gopath/bin/dlv dap --listen=127.0.0.1:43811 --log-dest=3 from /home/john/wsp/vscodewp/vscode-go-review/sampleWorkspace\n"
    }
}

s--> 调试器,事件,输出
{
    "seq": 0,
    "type": "event",
    "event": "output",
    "body": {
        "category": "console",
        "output": "DAP server listening at: 127.0.0.1:43811\n"
    }
}

s--> 调试器,应答
{
    "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
    }
}

c--> vscode,请求,launch启动
{
    "command": "launch",
    "arguments": {
        "name": "Launch Package",
        "type": "go",
        "request": "launch",
        "mode": "debug",
        "program": ".",
        "__configurationTarget": 6,
        "packagePathToGoModPathMap": {
            "/home/john/wsp/vscodewp/vscode-go-review/sampleWorkspace": "/home/john/wsp/vscodewp/vscode-go-review/sampleWorkspace"
        },
        "debugAdapter": "dlv-dap",
        "showRegisters": false,
        "showGlobalVariables": false,
        "substitutePath": [
            
        ],
        "showLog": false,
        "logOutput": "debugger",
        "dlvFlags": [
            
        ],
        "hideSystemGoroutines": false,
        "dlvToolPath": "/data/repo/golang/gopath/bin/dlv",
        "env": {
            "GOPATH": "/data/repo/golang/gopath"
        },
        "__buildDir": "/home/john/wsp/vscodewp/vscode-go-review/sampleWorkspace",
        "__sessionId": "7499259c-d87a-4fdf-b72c-0e12317153d2"
    },
    "type": "request",
    "seq": 2
}

s--> 调试器,事件,初始化完成
{
    "seq": 0,
    "type": "event",
    "event": "initialized"
}

s--> 调试器,应答
{
    "seq": 0,
    "type": "response",
    "request_seq": 2,
    "success": true,
    "command": "launch"
}

c--> vscode, 请求,设置断点
{
    "command": "setBreakpoints",
    "arguments": {
        "source": {
            "name": "main.go",
            "path": "/home/john/wsp/vscodewp/vscode-go-review/sampleWorkspace/main.go"
        },
        "lines": [
            6,
            8,
            12
        ],
        "breakpoints": [
            {
                "line": 6
            },
            {
                "line": 8
            },
            {
                "line": 12
            }
        ],
        "sourceModified": false
    },
    "type": "request",
    "seq": 3
}

c--> vscode,请求,设置函数断点
{
    "command": "setFunctionBreakpoints",
    "arguments": {
        "breakpoints": [
            
        ]
    },
    "type": "request",
    "seq": 4
}

c--> 
{
    "command": "setInstructionBreakpoints",
    "arguments": {
        "breakpoints": [
            
        ]
    },
    "type": "request",
    "seq": 5
}

s--> 
{
    "seq": 0,
    "type": "response",
    "request_seq": 3,
    "success": true,
    "command": "setBreakpoints",
    "body": {
        "breakpoints": [
            {
                "id": 1,
                "verified": true,
                "source": {
                    "name": "main.go",
                    "path": "/home/john/wsp/vscodewp/vscode-go-review/sampleWorkspace/main.go"
                },
                "line": 6
            },
            {
                "id": 2,
                "verified": true,
                "source": {
                    "name": "main.go",
                    "path": "/home/john/wsp/vscodewp/vscode-go-review/sampleWorkspace/main.go"
                },
                "line": 8
            },
            {
                "id": 3,
                "verified": true,
                "source": {
                    "name": "main.go",
                    "path": "/home/john/wsp/vscodewp/vscode-go-review/sampleWorkspace/main.go"
                },
                "line": 12
            }
        ]
    }
}

s--> 
{
    "seq": 0,
    "type": "response",
    "request_seq": 4,
    "success": true,
    "command": "setFunctionBreakpoints",
    "body": {
        "breakpoints": [
            
        ]
    }
}

s--> 
{
    "seq": 0,
    "type": "response",
    "request_seq": 5,
    "success": true,
    "command": "setInstructionBreakpoints",
    "body": {
        "breakpoints": [
            
        ]
    }
}

c--> 
{
    "command": "configurationDone",
    "type": "request",
    "seq": 6
}

s--> 
{
    "seq": 0,
    "type": "event",
    "event": "output",
    "body": {
        "category": "console",
        "output": "Type 'dlv help' for list of commands.\n",
        "source": {
            
        }
    }
}

s--> 
{
    "seq": 0,
    "type": "response",
    "request_seq": 6,
    "success": true,
    "command": "configurationDone"
}

c--> 
{
    "command": "threads",
    "type": "request",
    "seq": 7
}

s--> 
{
    "seq": 0,
    "type": "response",
    "request_seq": 7,
    "success": true,
    "command": "threads",
    "body": {
        "threads": [
            {
                "id": -1,
                "name": "Current"
            }
        ]
    }
}

s--> 
{
    "seq": 0,
    "type": "event",
    "event": "stopped",
    "body": {
        "reason": "breakpoint",
        "threadId": 1,
        "allThreadsStopped": true,
        "hitBreakpointIds": [
            1
        ]
    }
}

c--> 
{
    "command": "threads",
    "type": "request",
    "seq": 8
}

s--> 
{
    "seq": 0,
    "type": "response",
    "request_seq": 8,
    "success": true,
    "command": "threads",
    "body": {
        "threads": [
            {
                "id": 1,
                "name": "* [Go 1] main.main (Thread 1830529)"
            },
            {
                "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.runfinq"
            }
        ]
    }
}

s--> 
{
    "seq": 0,
    "type": "event",
    "event": "stopped",
    "body": {
        "reason": "step",
        "threadId": 1,
        "allThreadsStopped": true
    }
}

c--> 
{
    "command": "scopes",
    "arguments": {
        "frameId": 1000
    },
    "type": "request",
    "seq": 24
}

s--> 
{
    "seq": 0,
    "type": "response",
    "request_seq": 24,
    "success": false,
    "command": "scopes",
    "message": "Unable to list locals",
    "body": {
        "error": {
            "id": 2005,
            "format": "Unable to list locals: unknown frame id 1000",
            "showUser": false
        }
    }
}

c--> 
{
    "command": "stackTrace",
    "arguments": {
        "threadId": 1,
        "startFrame": 1,
        "levels": 19
    },
    "type": "request",
    "seq": 25
}

c--> 
{
    "command": "next",
    "arguments": {
        "threadId": 1
    },
    "type": "request",
    "seq": 26
}

s--> 
{
    "seq": 0,
    "type": "response",
    "request_seq": 25,
    "success": true,
    "command": "stackTrace",
    "body": {
        "stackFrames": [
            {
                "id": 1000,
                "name": "runtime.main",
                "source": {
                    "name": "proc.go",
                    "path": "/opt/my-apps/go/src/runtime/proc.go"
                },
                "line": 250,
                "column": 0,
                "instructionPointerReference": "0x43a253",
                "presentationHint": "subtle"
            },
            {
                "id": 1001,
                "name": "runtime.goexit",
                "source": {
                    "name": "asm_amd64.s",
                    "path": "/opt/my-apps/go/src/runtime/asm_amd64.s"
                },
                "line": 1598,
                "column": 0,
                "instructionPointerReference": "0x466d61",
                "presentationHint": "subtle"
            }
        ],
        "totalFrames": 3
    }
}

s--> {"seq":0,"type":"event","event":"continued","body":{"threadId":1,"allThreadsContinued":true}}

s--> {"seq":0,"type":"response","request_seq":26,"success":true,"command":"next"}

s--> {"seq":0,"type":"event","event":"stopped","body":{"reason":"step","threadId":1,"allThreadsStopped":true}}

s--> {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"结果:  3\n"}}

c--> {"command":"threads","type":"request","seq":27}

s--> {"seq":0,"type":"response","request_seq":27,"success":true,"command":"threads","body":{"threads":[{"id":1,"name":"* [Go 1] main.main (Thread 1830529)"},{"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"}]}}

c--> {"command":"stackTrace","arguments":{"threadId":1,"startFrame":0,"levels":1},"type":"request","seq":28}

s--> {"seq":0,"type":"response","request_seq":28,"success":true,"command":"stackTrace","body":{"stackFrames":[{"id":1000,"name":"main.main","source":{"name":"main.go","path":"/home/john/wsp/vscodewp/vscode-go-review/sampleWorkspace/main.go"},"line":14,"column":0,"instructionPointerReference":"0x49d248"}],"totalFrames":51}}

c--> {"command":"scopes","arguments":{"frameId":1000},"type":"request","seq":29}

s--> {"seq":0,"type":"response","request_seq":29,"success":true,"command":"scopes","body":{"scopes":[{"name":"Locals","variablesReference":1000,"expensive":false,"source":{}}]}}

c--> {"command":"variables","arguments":{"variablesReference":1000},"type":"request","seq":30}

s--> {"seq":0,"type":"response","request_seq":30,"success":true,"command":"variables","body":{"variables":[{"name":"a","value":"1","type":"int","presentationHint":{},"evaluateName":"a","variablesReference":0},{"name":"b","value":"2","type":"int","presentationHint":{},"evaluateName":"b","variablesReference":0},{"name":"c","value":"3","type":"int","presentationHint":{},"evaluateName":"c","variablesReference":0}]}}

c--> {"command":"stackTrace","arguments":{"threadId":1,"startFrame":1,"levels":19},"type":"request","seq":31}

s--> {"seq":0,"type":"response","request_seq":31,"success":true,"command":"stackTrace","body":{"stackFrames":[{"id":1001,"name":"runtime.main","source":{"name":"proc.go","path":"/opt/my-apps/go/src/runtime/proc.go"},"line":250,"column":0,"instructionPointerReference":"0x43a253","presentationHint":"subtle"},{"id":1002,"name":"runtime.goexit","source":{"name":"asm_amd64.s","path":"/opt/my-apps/go/src/runtime/asm_amd64.s"},"line":1598,"column":0,"instructionPointerReference":"0x466d61","presentationHint":"subtle"}],"totalFrames":3}}

c--> {"command":"threads","type":"request","seq":32}

s--> {"seq":0,"type":"response","request_seq":32,"success":true,"command":"threads","body":{"threads":[{"id":1,"name":"* [Go 1] main.main (Thread 1830529)"},{"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"}]}}

c--> {"command":"stackTrace","arguments":{"threadId":1,"startFrame":0,"levels":1},"type":"request","seq":33}

s--> {"seq":0,"type":"response","request_seq":33,"success":true,"command":"stackTrace","body":{"stackFrames":[{"id":1003,"name":"main.main","source":{"name":"main.go","path":"/home/john/wsp/vscodewp/vscode-go-review/sampleWorkspace/main.go"},"line":14,"column":0,"instructionPointerReference":"0x49d248"}],"totalFrames":51}}

c--> {"command":"scopes","arguments":{"frameId":1003},"type":"request","seq":34}

s--> {"seq":0,"type":"response","request_seq":34,"success":true,"command":"scopes","body":{"scopes":[{"name":"Locals","variablesReference":1001,"expensive":false,"source":{}}]}}

c--> {"command":"variables","arguments":{"variablesReference":1001},"type":"request","seq":35}

s--> {"seq":0,"type":"response","request_seq":35,"success":true,"command":"variables","body":{"variables":[{"name":"a","value":"1","type":"int","presentationHint":{},"evaluateName":"a","variablesReference":0},{"name":"b","value":"2","type":"int","presentationHint":{},"evaluateName":"b","variablesReference":0},{"name":"c","value":"3","type":"int","presentationHint":{},"evaluateName":"c","variablesReference":0}]}}

c--> {"command":"stackTrace","arguments":{"threadId":1,"startFrame":1,"levels":19},"type":"request","seq":36}

s--> {"seq":0,"type":"response","request_seq":36,"success":true,"command":"stackTrace","body":{"stackFrames":[{"id":1004,"name":"runtime.main","source":{"name":"proc.go","path":"/opt/my-apps/go/src/runtime/proc.go"},"line":250,"column":0,"instructionPointerReference":"0x43a253","presentationHint":"subtle"},{"id":1005,"name":"runtime.goexit","source":{"name":"asm_amd64.s","path":"/opt/my-apps/go/src/runtime/asm_amd64.s"},"line":1598,"column":0,"instructionPointerReference":"0x466d61","presentationHint":"subtle"}],"totalFrames":3}}

c--> {"command":"threads","type":"request","seq":37}

s--> {"seq":0,"type":"response","request_seq":37,"success":true,"command":"threads","body":{"threads":[{"id":1,"name":"* [Go 1] main.main (Thread 1830529)"},{"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"}]}}

c--> {"command":"stackTrace","arguments":{"threadId":1,"startFrame":0,"levels":1},"type":"request","seq":38}

s--> {"seq":0,"type":"response","request_seq":38,"success":true,"command":"stackTrace","body":{"stackFrames":[{"id":1006,"name":"main.main","source":{"name":"main.go","path":"/home/john/wsp/vscodewp/vscode-go-review/sampleWorkspace/main.go"},"line":14,"column":0,"instructionPointerReference":"0x49d248"}],"totalFrames":51}}

c--> {"command":"scopes","arguments":{"frameId":1006},"type":"request","seq":39}

s--> {"seq":0,"type":"response","request_seq":39,"success":true,"command":"scopes","body":{"scopes":[{"name":"Locals","variablesReference":1002,"expensive":false,"source":{}}]}}

c--> {"command":"variables","arguments":{"variablesReference":1002},"type":"request","seq":40}

s--> {"seq":0,"type":"response","request_seq":40,"success":true,"command":"variables","body":{"variables":[{"name":"a","value":"1","type":"int","presentationHint":{},"evaluateName":"a","variablesReference":0},{"name":"b","value":"2","type":"int","presentationHint":{},"evaluateName":"b","variablesReference":0},{"name":"c","value":"3","type":"int","presentationHint":{},"evaluateName":"c","variablesReference":0}]}}

c--> {"command":"stackTrace","arguments":{"threadId":1,"startFrame":1,"levels":19},"type":"request","seq":41}

s--> {"seq":0,"type":"response","request_seq":41,"success":true,"command":"stackTrace","body":{"stackFrames":[{"id":1007,"name":"runtime.main","source":{"name":"proc.go","path":"/opt/my-apps/go/src/runtime/proc.go"},"line":250,"column":0,"instructionPointerReference":"0x43a253","presentationHint":"subtle"},{"id":1008,"name":"runtime.goexit","source":{"name":"asm_amd64.s","path":"/opt/my-apps/go/src/runtime/asm_amd64.s"},"line":1598,"column":0,"instructionPointerReference":"0x466d61","presentationHint":"subtle"}],"totalFrames":3}}

c--> {"command":"next","arguments":{"threadId":1},"type":"request","seq":42}

s--> {"seq":0,"type":"event","event":"continued","body":{"threadId":1,"allThreadsContinued":true}}

s--> {"seq":0,"type":"response","request_seq":42,"success":true,"command":"next"}

s--> {"seq":0,"type":"event","event":"stopped","body":{"reason":"step","threadId":1,"allThreadsStopped":true}}

c--> {"command":"threads","type":"request","seq":43}

s--> {"seq":0,"type":"response","request_seq":43,"success":true,"command":"threads","body":{"threads":[{"id":1,"name":"* [Go 1] main.main (Thread 1830529)"},{"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"}]}}

c--> {"command":"stackTrace","arguments":{"threadId":1,"startFrame":0,"levels":1},"type":"request","seq":44}

s--> {"seq":0,"type":"response","request_seq":44,"success":true,"command":"stackTrace","body":{"stackFrames":[{"id":1000,"name":"main.main","source":{"name":"main.go","path":"/home/john/wsp/vscodewp/vscode-go-review/sampleWorkspace/main.go"},"line":17,"column":0,"instructionPointerReference":"0x49d24a"}],"totalFrames":51}}


c--> {"command":"scopes","arguments":{"frameId":1000},"type":"request","seq":45}

s--> {"seq":0,"type":"response","request_seq":45,"success":true,"command":"scopes","body":{"scopes":[{"name":"Locals","variablesReference":1000,"expensive":false,"source":{}}]}}

c--> {"command":"variables","arguments":{"variablesReference":1000},"type":"request","seq":46}

s--> {"seq":0,"type":"response","request_seq":46,"success":true,"command":"variables","body":{"variables":[{"name":"a","value":"1","type":"int","presentationHint":{},"evaluateName":"a","variablesReference":0},{"name":"b","value":"2","type":"int","presentationHint":{},"evaluateName":"b","variablesReference":0},{"name":"c","value":"3","type":"int","presentationHint":{},"evaluateName":"c","variablesReference":0}]}}

c--> {"command":"stackTrace","arguments":{"threadId":1,"startFrame":1,"levels":19},"type":"request","seq":47}

s--> {"seq":0,"type":"response","request_seq":47,"success":true,"command":"stackTrace","body":{"stackFrames":[{"id":1001,"name":"runtime.main","source":{"name":"proc.go","path":"/opt/my-apps/go/src/runtime/proc.go"},"line":250,"column":0,"instructionPointerReference":"0x43a253","presentationHint":"subtle"},{"id":1002,"name":"runtime.goexit","source":{"name":"asm_amd64.s","path":"/opt/my-apps/go/src/runtime/asm_amd64.s"},"line":1598,"column":0,"instructionPointerReference":"0x466d61","presentationHint":"subtle"}],"totalFrames":3}}

c--> {"command":"next","arguments":{"threadId":1},"type":"request","seq":48}

s--> {"seq":0,"type":"event","event":"continued","body":{"threadId":1,"allThreadsContinued":true}}

s--> {"seq":0,"type":"response","request_seq":48,"success":true,"command":"next"}

s--> {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"end\n"}}

s--> {"seq":0,"type":"event","event":"stopped","body":{"reason":"step","threadId":1,"allThreadsStopped":true}}

c--> {"command":"threads","type":"request","seq":49}

s--> {"seq":0,"type":"response","request_seq":49,"success":true,"command":"threads","body":{"threads":[{"id":1,"name":"* [Go 1] main.main (Thread 1830529)"},{"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"}]}}

c--> {"command":"stackTrace","arguments":{"threadId":1,"startFrame":0,"levels":1},"type":"request","seq":50}

s--> {"seq":0,"type":"response","request_seq":50,"success":true,"command":"stackTrace","body":{"stackFrames":[{"id":1000,"name":"main.main","source":{"name":"main.go","path":"/home/john/wsp/vscodewp/vscode-go-review/sampleWorkspace/main.go"},"line":18,"column":0,"instructionPointerReference":"0x49d2a5"}],"totalFrames":51}}

c--> {"command":"scopes","arguments":{"frameId":1000},"type":"request","seq":51}

s--> {"seq":0,"type":"response","request_seq":51,"success":true,"command":"scopes","body":{"scopes":[{"name":"Locals","variablesReference":1000,"expensive":false,"source":{}}]}}

c--> {"command":"variables","arguments":{"variablesReference":1000},"type":"request","seq":52}

s--> {"seq":0,"type":"response","request_seq":52,"success":true,"command":"variables","body":{"variables":[{"name":"a","value":"1","type":"int","presentationHint":{},"evaluateName":"a","variablesReference":0},{"name":"b","value":"2","type":"int","presentationHint":{},"evaluateName":"b","variablesReference":0},{"name":"c","value":"3","type":"int","presentationHint":{},"evaluateName":"c","variablesReference":0}]}}

c--> {"command":"stackTrace","arguments":{"threadId":1,"startFrame":1,"levels":19},"type":"request","seq":53}

s--> {"seq":0,"type":"response","request_seq":53,"success":true,"command":"stackTrace","body":{"stackFrames":[{"id":1001,"name":"runtime.main","source":{"name":"proc.go","path":"/opt/my-apps/go/src/runtime/proc.go"},"line":250,"column":0,"instructionPointerReference":"0x43a253","presentationHint":"subtle"},{"id":1002,"name":"runtime.goexit","source":{"name":"asm_amd64.s","path":"/opt/my-apps/go/src/runtime/asm_amd64.s"},"line":1598,"column":0,"instructionPointerReference":"0x466d61","presentationHint":"subtle"}],"totalFrames":3}}

c--> {"command":"next","arguments":{"threadId":1},"type":"request","seq":54}

s--> {"seq":0,"type":"event","event":"continued","body":{"threadId":1,"allThreadsContinued":true}}

s--> {"seq":0,"type":"response","request_seq":54,"success":true,"command":"next"}

s--> {"seq":0,"type":"event","event":"stopped","body":{"reason":"step","threadId":1,"allThreadsStopped":true}}


c--> 请求
{
    "command": "threads",
    "type": "request",
    "seq": 55
}

s--> 响应
{
    "seq": 0,
    "type": "response",
    "request_seq": 55,
    "success": true,
    "command": "threads",
    "body": {
        "threads": [
            {
                "id": 1,
                "name": "* [Go 1] runtime.main (Thread 1830529)"
            },
            {
                "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"
            }
        ]
    }
}


c--> 请求
{
    "command": "stackTrace",
    "arguments": {
        "threadId": 1,
        "startFrame": 0,
        "levels": 1
    },
    "type": "request",
    "seq": 56
}

s--> 堆栈
{
    "seq": 0,
    "type": "response",
    "request_seq": 56,
    "success": true,
    "command": "stackTrace",
    "body": {
        "stackFrames": [
            {
                "id": 1000,
                "name": "runtime.main",
                "source": {
                    "name": "proc.go",
                    "path": "/opt/my-apps/go/src/runtime/proc.go"
                },
                "line": 260,
                "column": 0,
                "instructionPointerReference": "0x43a253",
                "presentationHint": "subtle"
            }
        ],
        "totalFrames": 51
    }
}

c--> 请求
{
    "command": "stackTrace",
    "arguments": {
        "threadId": 1,
        "startFrame": 1,
        "levels": 19
    },
    "type": "request",
    "seq": 57
}

s--> 响应
{
    "seq": 0,
    "type": "response",
    "request_seq": 57,
    "success": true,
    "command": "stackTrace",
    "body": {
        "stackFrames": [
            {
                "id": 1001,
                "name": "runtime.goexit",
                "source": {
                    "name": "asm_amd64.s",
                    "path": "/opt/my-apps/go/src/runtime/asm_amd64.s"
                },
                "line": 1598,
                "column": 0,
                "instructionPointerReference": "0x466d61",
                "presentationHint": "subtle"
            }
        ],
        "totalFrames": 2
    }
}

c--> 
{
    "command": "scopes",
    "arguments": {
        "frameId": 1000
    },
    "type": "request",
    "seq": 58
}

s--> 
{
    "seq": 0,
    "type": "response",
    "request_seq": 58,
    "success": true,
    "command": "scopes",
    "body": {
        "scopes": [
            {
                "name": "Locals (warning: optimized function)",
                "variablesReference": 1000,
                "expensive": false,
                "source": {
                    
                }
            }
        ]
    }
}

c--> 变量
{
    "command": "variables",
    "arguments": {
        "variablesReference": 1000
    },
    "type": "request",
    "seq": 59
}

s--> 变量
{
    "seq": 0,
    "type": "response",
    "request_seq": 59,
    "success": true,
    "command": "variables",
    "body": {
        "variables": [
            {
                "name": "mp",
                "value": "*runtime.m {g0: *runtime.g {stack: (*runtime.stack)(0x53c7c0), stackguard0: 140721418760232, stackguard1: 140721418760232, _panic: *runtime._panic nil, _defer: *runtime._defer nil, m: *(*runtime.m)(0x53cb60), sched: (*runtime.gobuf)(0x53c7f8), syscallsp: 0...",
                "type": "*runtime.m",
                "presentationHint": {
                    
                },
                "evaluateName": "mp",
                "variablesReference": 1001
            },
            {
                "name": "needUnlock",
                "value": "(unreadable empty OP stack)",
                "type": "bool",
                "presentationHint": {
                    
                },
                "evaluateName": "needUnlock",
                "variablesReference": 0
            },
            {
                "name": "fn",
                "value": "(unreadable empty OP stack)",
                "type": "func()",
                "presentationHint": {
                    
                },
                "evaluateName": "fn",
                "variablesReference": 0
            }
        ]
    }
}

c--> 请求
{
    "command": "continue",
    "arguments": {
        "threadId": 1
    },
    "type": "request",
    "seq": 60
}

s--> 响应
{
    "seq": 0,
    "type": "response",
    "request_seq": 60,
    "success": true,
    "command": "continue",
    "body": {
        "allThreadsContinued": true
    }
}

s--> 事件
{
    "seq": 0,
    "type": "event",
    "event": "terminated",
    "body": {
        
    }
}

c--> 请求
{
    "command": "disconnect",
    "arguments": {
        "restart": false
    },
    "type": "request",
    "seq": 61
}

s--> 事件
{
    "seq": 0,
    "type": "event",
    "event": "output",
    "body": {
        "category": "console",
        "output": "Process 1830529 has exited with status 0\n",
        "source": {
            
        }
    }
}

s--> 事件
{
    "seq": 0,
    "type": "event",
    "event": "output",
    "body": {
        "category": "console",
        "output": "Detaching\n",
        "source": {
            
        }
    }
}

s--> 响应
{
    "seq": 0,
    "type": "response",
    "request_seq": 61,
    "success": true,
    "command": "disconnect"
}

s--> 事件
{
    "seq": 0,
    "type": "event",
    "event": "terminated",
    "body": {
        
    }
}

s--> 事件
{
    "seq": 0,
    "type": "event",
    "event": "output",
    "body": {
        "category": "console",
        "output": "dlv dap (1830402) exited with code: 0\n"
    }
}

标签:插件,name,seq,vscode,request,--,command,type,调试器
From: https://www.cnblogs.com/jiftle/p/17881199.html

相关文章

  • [good]vscode编译多个c源文件
    windows上实现vscode编译多个c源文件-知乎(zhihu.com)1、建立bin/doc/inc/app/src等目录2、bin目录用来存放生成的exe文件,doc用来存放帮助文档,inc用来存放*.h文件,app用来存放主程序main.c,src用来存放*.c文件3、修改lauch.json文件{//UseIntelliSensetolearnabo......
  • 超好用的IDEA插件,完全免费
    IDEA是一款功能强大的集成开发环境(IDE),它可以帮助开发人员更加高效地编写、调试和部署软件应用程序。我们在编写完接口代码后需要进行接口调试等操作,一般需要打开额外的调试工具。今天给大家介绍一款IDEA插件:Apipost-Helper-2.0。代码写完直接编辑器内调试、还支持生成接口文档、接......
  • 这款IDEA插件真的爱了
    前言Idea是一款功能强大的集成开发环境(IDE),它可以帮助开发人员更加高效地编写、调试和部署软件应用程序,Idea还具有许多插件和扩展,可以根据开发人员的需要进行定制和扩展,从而提高开发效率,今天我们就来介绍一款国产的API调试插件:Apipost-Helper什么是Apipost-Helper?Apipost-Helper......
  • Postman可以卸载了!这款IDEA插件太好用了!
    Postman是大家最常用的API调试工具,那么有没有一种方法可以不用手动写入接口到Postman,即可进行接口调试操作?今天给大家推荐一款IDEA插件:ApipostHelper,写完代码就可以调试接口并一键生成接口文档!而且还可以根据已有的方法帮助您快速生成url和params。更重要的是他完全免费!Apipost......
  • 超好用的IDEA插件,完全免费
    IDEA是一款功能强大的集成开发环境(IDE),它可以帮助开发人员更加高效地编写、调试和部署软件应用程序。我们在编写完接口代码后需要进行接口调试等操作,一般需要打开额外的调试工具。今天给大家介绍一款IDEA插件:Apipost-Helper-2.0。代码写完直接编辑器内调试、还支持生成接口文档、......
  • Apipost版IDEA插件
    Apipost-Helper是由Apipost推出的IDEA插件,写完接口可以进行快速调试,且支持搜索接口、根据method跳转接口,还支持生成标准的API文档,注意:这些操作都可以在代码编辑器内独立完成,非常好用!这里给大家介绍一下Apipost-Helper的安装和使用安装在IDEA编辑器插件中心输入Apipost搜索安装:......
  • win上vscode出现undefined reference to `__imp_WSACleanup'
    示例代码#include<iostream>//推荐加上宏定义#defineWIN32_LEAN_AND_MEAN#include<winsock2.h>#include<Windows.h>usingnamespacestd;intmain(){WORDver=MAKEWORD(2,2);WSADATAdat;WSAStartup(ver,&dat);WSACleanup();retur......
  • 解决谷歌浏览器 Google Chrome不能拖拽安装离线插件的办法
    我使用的谷歌浏览器版本是119.0.6045.160(正式版本)(64位)  之前多台电脑都可以通过拖拽安装crx格式的扩展程序,最近公司配好了新的笔记本,但今天下载好crx文件发现拖动之后并不可以安装,并且已经打开了开发者模式,还是会显示禁用的小图标。解决方式首先打开下面地址:chrome://fla......
  • VSCode 自定义 “Go to File”workbench.action.quickOpenNavigateNextInFilePicker
    默认情况下,是使用Ctrl+p也只能向下进行选择,如果用down或者up手则需要离开主键盘区域,非常的不方便。放到vscode配置快捷键的json文件中{"key":"ctrl+n","command":"workbench.action.quickOpenNavigateNext","when":"inFile......
  • vscode快捷键误删恢复
    我在配置vscode的PicGo插件的时候误删了快捷键,现在讲一下怎么恢复......