Skip to content

Instantly share code, notes, and snippets.

@jwpleow
Last active February 8, 2023 02:19
Show Gist options
  • Select an option

  • Save jwpleow/d7c2c5fbcd83c4b21c63566be9c0d8cd to your computer and use it in GitHub Desktop.

Select an option

Save jwpleow/d7c2c5fbcd83c4b21c63566be9c0d8cd to your computer and use it in GitHub Desktop.
gdb setup on vscode
// Available variables which can be used inside of strings.
// ${workspaceRoot}: the root folder of the team
// ${file}: the current opened file
// ${fileBasename}: the current opened file's basename
// ${fileDirname}: the current opened file's dirname
// ${fileExtname}: the current opened file's extension
// ${cwd}: the current working directory of the spawned process
{
// 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": [
{
"name": "(gdb) Debug",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceRoot}/build/Debug/dashXplorer/dashXplorer",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceRoot}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "Build",
"miDebuggerPath": "/usr/bin/gdb"
}
]
}
{
"tasks": [
{
"type": "shell",
"label": "DebugBuild",
"command": "/usr/local/bin/cmake",
"args": [
"-GNinja",
"-DCMAKE_TOOLCHAIN_FILE=~/vcpkg/scripts/buildsystems/vcpkg.cmake",
"-DCMAKE_EXPORT_COMPILE_COMMANDS=1",
"-DCMAKE_BUILD_TYPE=Debug",
"-DBUILD_SHARED_LIBS=Off",
".."
],
"options": {
"cwd": "${workspaceFolder}/build" // Build result directory
}
},
{
"type": "shell",
"label": "Build",
"command": "/usr/bin/ninja",
"args": [
],
"options": {
"cwd": "${workspaceFolder}/build" // Build result directory
},
"group": {
"kind": "build",
"isDefault": true
},
"dependsOn": [
"DebugBuild"
]
}
],
"version": "2.0.0"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment