当前位置:   article > 正文

vscode中C++调试launch.json配置_launch.json如何配置c++

launch.json如何配置c++

.vscode目录下,

launch.json内容,

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "cc",
            "type": "cppdbg",
            "request": "launch",
            "preLaunchTask": "make",
            "program": "/home/fyw/bin/run_cloud_aggregation",
            "args": [
                "--output_cloud_res=/home/fyw/download/junction_17629/res",
                "--inputjson=/home/fyw/download/junction_17629/in.json",
                "--deploy_path=/opt/work/csm_workspace/csm_alg_sched/../exec/output/model/"
            ],
            "stopAtEntry": false,
            "cwd": "/home/fyw",
            "externalConsole": false,
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ],
            "linux": {
                "MIMode": "gdb"
            },
            "miDebuggerPath": "/usr/bin/gdb"
        }
    ]
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

各字段介绍如下:

  1. program表示可执行文件。
  2. args表示传入参数。
  3. cwd表示当前工作目录。
  4. miDebuggerPath表示调试器目录。

tasks.json内容,

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "make",
            "type": "shell",
            "command": "sh /home/fyw/run.sh"
        }
    ]
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Monodyee/article/detail/461151
推荐阅读
相关标签
  

闽ICP备14008679号