launch.json 2.78 KB
{
    "version": "0.2.0",
    "configurations": [
        // Need to separate debug configurations because
        // they use different debuggers

        // If you want to create a configuration for a specific binary,
        // it would look like these two, with the corresponding stuff in tasks
        {
            "name": "(Windows) Debug bin/bounce",
            "type": "cppvsdbg",
            "request": "launch",
            "program": "${workspaceFolder}/bin/bounce.exe",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "console": "newExternalWindow",
            "preLaunchTask": "make bin/bounce",
        },
        {
            "name": "(OS X / Linux) Debug bin/bounce",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceFolder}/bin/bounce",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "miDebuggerPath": "/usr/bin/gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ],
            "preLaunchTask": "make bin/bounce",
        },

        // On the other hand, there's a _lot_ of test suites, and I don't
        // want to write a configuration for all of them.
        // This config actually works for demos too!
        {
            "name": "(Windows) Debug active file",
            "type": "cppvsdbg",
            "request": "launch",
            "program": "${workspaceFolder}/bin/${fileBasenameNoExtension}.exe",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "console": "newExternalWindow",
            "preLaunchTask": "make active file",
        },
        {
            "name": "(OS X / Linux) Debug active file",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceFolder}/bin/${fileBasenameNoExtension}",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "miDebuggerPath": "/path/to/gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ],
            "preLaunchTask": "make active file",
        },
    ]
}