vscode调试同一文件夹中的多个文件

时间:2020-07-07 19:19:39

标签: c++ visual-studio-code vscode-debugger

我是C ++和vscode的新手。我知道如何在单个.cc文件中运行vscode调试器,但我不知道如何在具有多个.h和.cc文件的文件夹中运行它(我有Makefile,并且链接正常工作)。我当前的解决方案是将整个项目复制并粘贴到一个文件中,然后运行效率非常低的调试器。

我怀疑我必须修改launch.json,所以这是我的。任何提示表示赞赏!

{
"version": "0.2.0",
"configurations": [
    {
        "name": "g++ - Build and debug active file",
        "type": "cppdbg",
        "request": "launch",
        "program": "${fileDirname}/${fileBasenameNoExtension}",
        "args": [],
        "stopAtEntry": false,
        "cwd": "${workspaceFolder}",
        "environment": [],
        "externalConsole": false,
        "MIMode": "gdb",
        "setupCommands": [
            {
                "description": "Enable pretty-printing for gdb",
                "text": "-enable-pretty-printing",
                "ignoreFailures": true
            }
        ],
        "preLaunchTask": "C/C++: g++ build active file",
        "miDebuggerPath": "/usr/bin/gdb"
    }
]

}

0 个答案:

没有答案
相关问题