VS Code C / C ++调试器未启动

时间:2019-02-07 18:18:02

标签: visual-studio-code

每次我按F5键开始调试时,它就永远不会启动。

已生成文件,但变量窗口中未显示任何内容。

屏幕截图:VS Code status after pressing F5

这是我的配置:

launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "(gdb) Launch",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceRoot}/build/${fileBasenameNoExtension}.exe",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceRoot}/build",
            "environment": [],
            "externalConsole": true,
            "MIMode": "gdb",
            "miDebuggerPath": "c:/MinGW/bin/gdb.exe",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ],
            "preLaunchTask": "build & debug"
        }
    ]
}

tasks.json

{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "build & debug",
      "type": "shell",
      "command": "g++",
      "args": [
        "-o",
        "build\\${fileBasenameNoExtension}",
        "${file}",
        "-g"
      ],
      "group": {
        "kind": "build",
        "isDefault": true
      }
    },
    {
      "label": "build & run",
      "type": "shell",
      "command": "g++",
      "args": [
        "-o",
        "build\\${fileBasenameNoExtension}",
        "${file}"
      ],
      "group": {
        "kind": "build",
        "isDefault": true
      }
    }
  ]
}

我想知道如何解决此问题及其发生方式。

0 个答案:

没有答案