Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Commit

Permalink
refactor attach feature
Browse files Browse the repository at this point in the history
Added template for attaching to process.
Fixed template for connecting to a server.
Removed unnecessary fields from AttachRequestArguments
Cleaned up Delve.constructor to remove unnecessary parameters.
Removed duplicated code from attachRequest().
Cleaned up handling of legacy 'useApiV1' setting.
Ensure that property 'cwd' is set in debug configuration.
  • Loading branch information
jhendrixMSFT committed Mar 18, 2019
1 parent 86c35dd commit 26084e0
Show file tree
Hide file tree
Showing 3 changed files with 409 additions and 171 deletions.
161 changes: 153 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -351,20 +351,28 @@
]
}
},
{
"label": "Go: Attach to process",
"description": "Attach to an existing process by process ID",
"body": {
"name": "${1:Attach to Process}",
"type": "go",
"request": "attach",
"mode": "attach",
"processId": 0
}
},
{
"label": "Go: Connect to server",
"description": "Connect to a remote headless debug server",
"body": {
"name": "${3:Connect to server}",
"name": "${1:Connect to server}",
"type": "go",
"request": "launch",
"mode": "remote",
"remotePath": "^\"\\${workspaceFolder}${1:}\"",
"request": "attach",
"mode": "connect",
"remotePath": "^\"\\${workspaceFolder}\"",
"port": 2345,
"host": "127.0.0.1",
"program": "^\"\\${workspaceFolder}${1:}\"",
"env": {},
"args": []
"host": "127.0.0.1"
}
}
],
Expand Down Expand Up @@ -540,6 +548,143 @@
"description": "Boolean value to indicate whether global package variables should be shown in the variables pane or not."
}
}
},
"attach": {
"required": [],
"properties": {
"processId": {
"type": "number",
"description": "The ID of the process to be debugged."
},
"mode": {
"enum": [
"attach",
"connect"
],
"description": "One of 'auto', 'debug', 'remote', 'test', 'exec'.",
"default": "auto"
},
"stopOnEntry": {
"type": "boolean",
"description": "Automatically stop program after launch.",
"default": false
},
"showLog": {
"type": "boolean",
"description": "Show log output from the delve debugger.",
"default": false
},
"cwd": {
"type": "string",
"description": "Workspace relative or absolute path to the working directory of the program being debugged. Default is the current workspace.",
"default": "${workspaceFolder}"
},
"remotePath": {
"type": "string",
"description": "If remote debugging, the path to the source code on the remote machine, if different from the local machine.",
"default": ""
},
"port": {
"type": "number",
"description": "The port that the delve debugger will be listening on.",
"default": 2345
},
"host": {
"type": "string",
"description": "The host name of the machine the delve debugger will be listening on.",
"default": "127.0.0.1"
},
"trace": {
"type": [
"boolean",
"string"
],
"enum": [
"verbose",
true
],
"default": true,
"description": "When 'true', the extension will log diagnostic info to a file. When 'verbose', it will also show logs in the console."
},
"backend": {
"type": "string",
"enum": [
"default",
"native",
"lldb"
],
"description": "Backend used by delve. Only available in delve version 0.12.2 and above."
},
"logOutput": {
"type": "string",
"enum": [
"debugger",
"gdbwire",
"lldbout",
"debuglineerr",
"rpc"
],
"description": "Comma separated list of components that should produce debug output.",
"default": "debugger"
},
"dlvLoadConfig": {
"type": "object",
"properties": {
"followPointers": {
"type": "boolean",
"description": "FollowPointers requests pointers to be automatically dereferenced",
"default": true
},
"maxVariableRecurse": {
"type": "number",
"description": "MaxVariableRecurse is how far to recurse when evaluating nested types",
"default": 1
},
"maxStringLen": {
"type": "number",
"description": "MaxStringLen is the maximum number of bytes read from a string",
"default": 64
},
"maxArrayValues": {
"type": "number",
"description": "MaxArrayValues is the maximum number of elements read from an array, a slice or a map",
"default": 64
},
"maxStructFields": {
"type": "number",
"description": "MaxStructFields is the maximum number of fields read from a struct, -1 will read all fields",
"default": -1
}
},
"description": "LoadConfig describes to delve, how to load values from target's memory",
"default": {
"followPointers": true,
"maxVariableRecurse": 1,
"maxStringLen": 64,
"maxArrayValues": 64,
"maxStructFields": -1
}
},
"apiVersion": {
"type": "number",
"enum": [
1,
2
],
"description": "Delve Api Version to use. Default value is 2.",
"default": 2
},
"stackTraceDepth": {
"type": "number",
"description": "Maximum depth of stack trace collected from Delve",
"default": 50
},
"showGlobalVariables": {
"type": "boolean",
"default": true,
"description": "Boolean value to indicate whether global package variables should be shown in the variables pane or not."
}
}
}
}
}
Expand Down
Loading

0 comments on commit 26084e0

Please sign in to comment.