VS代码忽略了c ++调试中的断点

Has*_*war 3 c++ visual-studio-debugging visual-studio-code

我正在调试VS Code中的c ++代码,但它不会在断点上停止并可视化变量,监视和调用堆栈,它本应该这样做.而不是这个,它在调试控制台中打印:

Breakpoint 1, 0x000000000040074a in main ()
[Inferior 1 (process 9445) exited normally]
The program '/home/hashir/x/a.out' has exited with code 0 (0x00000000)
Run Code Online (Sandbox Code Playgroud)

这是launch.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": "/home/hashir/x/a.out",
            "args": [],
            "stopAtEntry": false,
            "cwd": "/home/hashir/x/",
            "environment": [],
            "externalConsole": true,
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ]
        }
    ]
}
Run Code Online (Sandbox Code Playgroud)

Has*_*war 8

使用-gtag和g ++/clang ++ 来编写程序