Visual Studio Code Debugger for C无法启动

时间:2018-11-25 19:07:21

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

我正在尝试在Visual Studio代码中为C编程环境设置调试器。我在代码中添加了一个断点,但随后单击了“开始调试”,没有任何反应。

这是我的json文件,看起来像:

{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [

    {
        "name": "(gdb) Launch",
        "type": "cppdbg",
        "request": "launch",
        "program": "${workspaceFolder}/MyProgram.exe",
        "args": [],
        "stopAtEntry": false,
        "cwd": "${workspaceFolder}",
        "environment": [],
        "externalConsole": true,
        "MIMode": "gdb",
        "miDebuggerPath": "/usr/bin/gdb",
        "setupCommands": [
            {
                "description": "Enable pretty-printing for gdb",
                "text": "-enable-pretty-printing",
                "ignoreFailures": true
            }
        ]
    }
]
}

我的make文件如下:

    all: MyProgram.exe

    MyProgram.exe: main.o array.o
        gcc -o MyProgram.exe main.o array.o

    main.o: main.c
        gcc -g -c main.c

    array.o: array.c
        gcc -g -c array.c

    clean:
        rm *.o *.exe

我可以用相同的编译输出很好地启动ddd,但是由于某种原因无法使VS Code调试器正常工作。我想念什么吗?

0 个答案:

没有答案