Skip to content

Instantly share code, notes, and snippets.

@btgoodwin
Created October 17, 2023 12:57
Show Gist options
  • Save btgoodwin/306786c0f6eed9b086136cd4111931d3 to your computer and use it in GitHub Desktop.
Save btgoodwin/306786c0f6eed9b086136cd4111931d3 to your computer and use it in GitHub Desktop.
VSCode GDB Launch Settings for GStreamer's "gcheck" test framework
{
"configurations": [
{
"name": "Debug GCheck Test",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/path/to/executable",
"args": [],
"stopAtEntry": true,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Enable randomization for gdb",
"text": "-enable-randomization",
"ignoreFailures": true
},
{
"description": "GDB stays attached to both processes on fork for gdb",
"text": "-gdb-set detach-on-fork off",
"ignoreFailures": true
},
{
"description": "Follow child on fork for gdb",
"text": "-gdb-set follow-fork-mode child",
"ignoreFailures": true
}
]
}
]
}
@btgoodwin
Copy link
Author

The first two setupCommands are typical things. The second two though are necessary to keep the gdb instance attached to the unit under test. Additionally, stopAtEntry: true is often required for a breakpoint within a test to actually be registered across the reattachment behavior. If you find that running false there works for you, then perhaps they fixed this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment