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

成功停在了这里:

相关推荐
临床数据科学和人工智能兴趣组7 小时前
R语言中,列表是一种非常灵活的数据结构,它可以存储不同类型的对象,如向量、矩阵、数据框、甚至其他列表
数据结构·数据库·r语言·r语言-4.2.1·临床试验
cmes_love7 小时前
期货五档Level2行情数据和分钟历史行情数据下载分析
数据库
某不知名網友7 小时前
MySQL数据库库级操作|创建、字符集、修改删除、备份恢复
数据库·mysql
zone_z8 小时前
Oracle 数据库基础故障排查系列(12 篇)
数据库·oracle·dba·troubleshooting·blog-series
DBA_G8 小时前
GBase 8a数据库RANGE分区操作详细解读
数据库·oracle
2501_915918418 小时前
iOS 真机调试工具推荐,安装运行、性能分析有哪些工具
ide·vscode·ios·objective-c·个人开发·swift·敏捷流程
三言老师8 小时前
K8s 集群 Ceph 节点磁盘分区规划配置实操
linux·运维·数据库
某不知名網友9 小时前
MySQL数据表详解|创建、查看、修改、删除实战教程
数据库·mysql
Wang's Blog9 小时前
PostgreSQL笔记20: 实例、集群、模板数据库与表空间 —— 逻辑体系架构深度解析
数据库·笔记·postgresql
FZdydz12 小时前
大禹电子多普勒流量计小管径生活污水排污口流量监测应用案例
百度·编辑器·新浪微博