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模式为调试当前文件.

成功停在了这里:

相关推荐
深海小黄鱼11 小时前
mysql 导入csv文件太慢, Error Code: 1290.
数据库·mysql
小宇的天下11 小时前
Calibre Connectivity Extraction(21-1)
数据库·oracle
rannn_11111 小时前
【Java项目】中北大学Java+数据库课设|校园食堂智能推荐与反馈系统
java·数据库·后端·课程设计·中北大学
DBA小马哥11 小时前
从Oracle到信创数据库:一场技术迁移的探索之旅
数据库·oracle
2501_9445210011 小时前
rn_for_openharmony商城项目app实战-语言设置实现
javascript·数据库·react native·react.js·harmonyos
AdleyTales11 小时前
vscode识别不了@提示找不到路径解决
前端·javascript·vscode
飞Link11 小时前
【Sqoop】Sqoop 使用教程:从原理到实战的完整指南
数据库·hadoop·sqoop
此生只爱蛋11 小时前
【Redis】事务
数据库·redis·缓存
野犬寒鸦11 小时前
从零起步学习MySQL || 第十六章:MySQL 分库分表的考量策略
java·服务器·数据库·后端·mysql
cyhysr11 小时前
2025sql大赛题:仅用sql处理数独
数据库·sql·oracle