Search:

PmWiki

pmwiki.org

edit SideBar

Main / Vscode

ctrl + shift + P brings up the commands list.

When you use the Git clone option, note that VS Code will not init submodules, so you must still do this manually on the terminal line with git submodule update --init --recursive.

GDB Debugging

To debug C or C++ programs in Visual Studio Code using GDB, you must configure a launch.json file inside your project's .vscode folder. So you'll have or create the .vscode folder at the top level of your workspace.

Example launch file:

{
    // 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) Launch",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceFolder}/ExampleProjects/Simple_Discovery/build/Example2_DeviceDiscovery",
            "args": ["/dev/ttyACM0"],
            "stopAtEntry": true,
            "cwd": "${fileDirname}",
            "environment": [ { "name": "DEBUGINFOD_URLS", "value": "" } ],
            "externalConsole": false,
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                },
                {
                    "description": "Set Disassembly Flavor to Intel",
                    "text": "-gdb-set disassembly-flavor intel",
                    "ignoreFailures": true
                },
                {
                    "description": "Disable debuginfod to prevent GDB hanging",
                    "text": "-gdb-set debuginfod enabled off",
                    "ignoreFailures": true
                },
                {
                    "description": "Disable debuginfod to bypass extension bug",
                    "text": "set debuginfod urls ",
                    "ignoreFailures": true
                },

            ]
        }


    ]
}



Page last modified on July 10, 2026, at 04:32 PM