vscode配置debug使用的launch.json文件

{
    // 使用 IntelliSense 了解相关属性。 
    // 悬停以查看现有属性的描述。
    // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Current File",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal",
            "cwd": "${workspaceFolder}/build/src"
        },
        {
            "name": "(gdb) f4opc.py",
            "type": "python",
            "request": "launch",
            "program": "${workspaceFolder}/build/src/f4opc.py",
            "args": [],
            "console": "integratedTerminal",
            "cwd": "${workspaceFolder}/build/src"
        },
        {
            "name": "(gdb) f4opcad.py",
            "type": "python",
            "request": "launch",
            "program": "${workspaceFolder}/build/src/f4opcad.py",
            "args": [],
            "console": "integratedTerminal",
            "cwd": "${workspaceFolder}/build/src"
        },
        {
            "name": "(gdb) f4opt.py",
            "type": "python",
            "request": "launch",
            "program": "${workspaceFolder}/build/src/f4ConCali.py",
            "args": ["opt"],
            "console": "integratedTerminal",
            "cwd": "${workspaceFolder}/build/src"
        },
        {
            "name": "(gdb) f4lp_pie.py",
            "type": "python",
            "request": "launch",
            "program": "${workspaceFolder}/build/src/f4lp_pie.py",
            "args": [],
            "console": "integratedTerminal",
            "cwd": "${workspaceFolder}/build/src"
        },
        {
            "name": "(gdb) f4pw.py",
            "type": "python",
            "request": "launch",
            "program": "${workspaceFolder}/build/src/f4pw.py",
            "args": [],
            "console": "integratedTerminal",
            "cwd": "${workspaceFolder}/build/src"
        },
        {
            "name": "(gdb) Attach",
            "type": "cppdbg",
            "request": "attach",
            "program": "/usr/bin/python3",
            "processId": "${command:pickProcess}",
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ]
        },
        {
            "name": "(gdb) simple_test",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceFolder}/build/src/do_opc",
            "args": [],
            "console": "integratedTerminal",
            "cwd": "${workspaceFolder}/build/src"
        }
    ]
}

注意"cwd": "${workspaceFolder}/build/src",表示debug时的当前路径是在工程目录的build/src下,如果没设置,可能导致中间文件输出到其他目录。

上述json各个属性的含义或你想了解更多VsCode的信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387

你可能感兴趣的:(Visual,Studio,VsCode,vscode,json,ide)