vscode 配置cpp调试环境

c_cpp_properties.json

复制代码
{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "/usr/src/linux-headers-6.8.0-90/include",
                "${workspaceFolder}/**"
            ],
            "defines": [],
            "compilerPath": "/usr/bin/gcc",
            "cStandard": "c17",
            "cppStandard": "gnu++17",
            "intelliSenseMode": "linux-gcc-x64"
        }
    ],
    "version": 4
}

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": "${workspaceFolder}/a.out",
        "args": [],
        "stopAtEntry": false,
        "cwd": "${fileDirname}",
        "environment": [],
        "externalConsole": false,
        "MIMode": "gdb",
        "setupCommands": [
            {
                "description": "Enable pretty-printing for gdb",
                "text": "-enable-pretty-printing",
                "ignoreFailures": true
            },
            {
                "description": "Set Disassembly Flavor to Intel",
                "text": "-gdb-set disassembly-flavor intel",
                "ignoreFailures": true
            }
        ]
      }
      ]
}

设置这个debug模式为调试当前文件.

成功停在了这里:

相关推荐
TG:@yunlaoda360 云老大2 小时前
华为云国际站代理商GaussDB主要有什么作用呢?
服务器·数据库·华为云·gaussdb
ohoy2 小时前
业务数据聚合分析 xxl-job定时任务
数据库·oracle
weixin_404679312 小时前
解决vscode, cpp库包找不到问题
ide·vscode·编辑器
数据皮皮侠AI2 小时前
数字经济政策工具变量数据(2008-2023)
大数据·数据库·人工智能·笔记·1024程序员节
赫尔·普莱蒂科萨·帕塔2 小时前
从 “脑梗“ 到 “功夫高手“
数据库·人工智能·agi
IvanCodes3 小时前
openGauss 存储核心机制:从表空间到数据块
数据库·sql·oracle·opengauss
Francek Chen3 小时前
【IoTDB】时序数据库选型指南:国产自研技术如何应对数据洪流
大数据·数据库·时序数据库·iotdb
白露与泡影3 小时前
春招 Java 面试大纲:Java+ 并发 +spring+ 数据库 +Redis+JVM+Netty 等
java·数据库·面试
倔强的石头_3 小时前
金仓数据库 MongoDB 兼容:多模融合下的架构之道与实战体验
数据库