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

成功停在了这里:

相关推荐
静听山水13 分钟前
StarRocks表模型详解
数据库
静听山水19 分钟前
Redis核心数据结构-Set
数据结构·数据库·redis
数研小生34 分钟前
亚马逊商品列表API详解
前端·数据库·python·pandas
洛豳枭薰35 分钟前
MySQL 并行复制
数据库·mysql
无尽的沉默36 分钟前
Redis下载安装
数据库·redis·缓存
czlczl200209251 小时前
增删改查时如何提高Mysql与Redis的一致性
数据库·redis·mysql
打工的小王1 小时前
MySql(二)索引
数据库·mysql
数据知道1 小时前
PostgreSQL 性能优化:如何提高数据库的并发能力?
数据库·postgresql·性能优化
wengqidaifeng1 小时前
数据结构(三)栈和队列(上)栈:计算机世界的“叠叠乐”
c语言·数据结构·数据库·链表
数据知道1 小时前
PostgreSQL性能优化:内存配置优化(shared_buffers与work_mem的黄金比例)
数据库·postgresql·性能优化