Skip to content

Commit

Permalink
Enable debugging in VSCode on Windows
Browse files Browse the repository at this point in the history
Adds config to use the Visual Studio debugger on Windows.
  • Loading branch information
ohodson committed Apr 22, 2023
1 parent a48fd75 commit afdff92
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 14 deletions.
29 changes: 19 additions & 10 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
{
"name": "workerd debug",
"preLaunchTask": "Bazel Build (dbg)",
"program": "linux-or-os-only",
"program": "workerd",
"request": "launch",
"type": "cppdbg",
"cwd": "${workspaceFolder}",
"linux": {
"name": "workerd debug",
"type": "cppdbg",
"request": "launch",
"MIMode": "gdb",
"miDebuggerArgs": "-d ${workspaceFolder}",
"program": "workerd",
"cwd": "${workspaceFolder}/bazel-out/k8-dbg/bin/src/workerd/server/workerd.runfiles/workerd/src/workerd/server/",
"program": "${workspaceFolder}/bazel-out/k8-dbg/bin/src/workerd/server/workerd.runfiles/workerd/src/workerd/server/workerd",
},
"osx": {
"name": "workerd debug",
Expand All @@ -31,29 +31,34 @@
"bazel-out" : "${workspaceFolder}/bazel-out",
"external" : "${workspaceFolder}/external"
},
"cwd": "${workspaceFolder}",
},
"windows": {
"name": "workerd debug",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceRoot}\\bazel-out\\x64_windows-dbg\\bin\\src\\workerd\\server\\workerd.exe",
},
"args": [
"serve",
"${input:workerdConfig}"
],
"stopAtEntry": false,
"externalConsole": false
"externalConsole": false,
},
{
"name": "workerd debug with inspector enabled",
"preLaunchTask": "Bazel Build (dbg)",
"program": "linux-or-os-only",
"program": "workerd",
"type": "cppdbg",
"request": "launch",
"cwd": "${workspaceFolder}",
"linux": {
"name": "workerd debug with inspector enabled",
"type": "cppdbg",
"request": "launch",
"MIMode": "gdb",
"miDebuggerArgs": "-d ${workspaceFolder}",
"program": "workerd",
"cwd": "${workspaceFolder}/bazel-out/k8-dbg/bin/src/workerd/server/workerd.runfiles/workerd/src/workerd/server/",
"program": "${workspaceFolder}/bazel-out/k8-dbg/bin/src/workerd/server/workerd.runfiles/workerd/src/workerd/server/workerd",
},
"osx": {
"name": "workerd debug with inspector enabled",
Expand All @@ -67,15 +72,19 @@
"bazel-out" : "${workspaceFolder}/bazel-out",
"external" : "${workspaceFolder}/external"
},
"cwd": "${workspaceFolder}",
},
"windows": {
"name": "workerd debug",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceRoot}\\bazel-out\\x64_windows-dbg\\bin\\src\\workerd\\server\\workerd.exe",
},
"args": [
"serve",
"-i0.0.0.0",
"--verbose",
"${input:workerdConfig}"
],
"cwd": "${workspaceFolder}/bazel-out/k8-dbg/bin/src/workerd/server/workerd.runfiles/workerd",
"stopAtEntry": false,
"externalConsole": false
}
Expand Down
6 changes: 2 additions & 4 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
"label": "Bazel Build (dbg)",
"type": "shell",
"command": "bazel",
"linux": {
"args": ["build", "-c", "dbg", "//src/workerd/server:workerd"],
},
"args": ["build", "-c", "dbg", "//src/workerd/server:workerd"],
"osx": {
// OS X needs additional build options for symbols to work correctly
// (https://github.com/bazelbuild/bazel/issues/6327), hence the additional
Expand Down Expand Up @@ -101,7 +99,7 @@
"panel": "dedicated"
},
"runOptions": {
"runOn": "folderOpen"
"runOn": "default"
}
},
{
Expand Down

0 comments on commit afdff92

Please # to comment.