mirror of
https://github.com/lxc/incus.git
synced 2026-02-05 09:46:19 +01:00
The Visual Studio Code editor has the ability to attach to or launch golang binaries for interactive debugging, with variable inspection and breakpoints The launch.json file adds the following menu entries to the "Run and Debug" menu in VS Code - Attach to Incusd - Launch Incusd - Launch Incusd --debug The first menu will allow the user to select a running incusd instance to attach the VS Code Go Delve debugger to. The other two options will launch the most recently built incusd, with or without the --debug option, allowing live debugging in the editor with breakpoints Assuming incusd is built into the ~/go/bin directory. Signed-off-by: Stuart Espey <stuart.espey@mactrix.com>
57 lines
2.0 KiB
JSON
57 lines
2.0 KiB
JSON
{
|
|
// Use IntelliSense to learn about possible attributes.
|
|
// Hover to view descriptions of existing attributes.
|
|
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
"version": "0.2.0",
|
|
"configurations": [
|
|
|
|
{
|
|
// if the incusd is running, this will attach to it.
|
|
"name": "Attach to Incusd",
|
|
"type": "go",
|
|
"request": "attach",
|
|
"mode": "local",
|
|
"processId": "incusd",
|
|
"asRoot":true,
|
|
"console": "integratedTerminal"
|
|
},
|
|
{
|
|
|
|
// after running `make` to install incusd, assuming that your go/bin is in your home directory, this should launch incusd if its not a service.
|
|
// if it is an active service, you actually need to restart the service, and then attach to it.
|
|
"name": "Launch Incusd",
|
|
"type":"go",
|
|
"request": "launch",
|
|
"mode": "exec",
|
|
"asRoot": true,
|
|
"program": "${userHome}/go/bin/incusd",
|
|
"env": {
|
|
"PATH": "${env:PATH}:${userHome}/go/bin/",
|
|
"LD_LIBRARY_PATH": "${userHome}/go/deps/raft/.libs/:${userHome}/go/deps/cowsql/.libs/"
|
|
},
|
|
"args": [
|
|
"--group",
|
|
"sudo"
|
|
],
|
|
"console": "integratedTerminal",
|
|
},
|
|
{
|
|
"name": "Launch Incusd --debug",
|
|
"type":"go",
|
|
"request": "launch",
|
|
"mode": "exec",
|
|
"asRoot": true,
|
|
"program": "${userHome}/go/bin/incusd",
|
|
"env": {
|
|
"PATH": "${env:PATH}:${userHome}/go/bin/",
|
|
"LD_LIBRARY_PATH": "${userHome}/go/deps/raft/.libs/:${userHome}/go/deps/cowsql/.libs/"
|
|
},
|
|
"args": [
|
|
"--group",
|
|
"sudo",
|
|
"--debug"
|
|
],
|
|
"console": "integratedTerminal",
|
|
}
|
|
]
|
|
} |