ubuntu22下使用vscode调试redis7源码环境搭建

ubuntu22下使用vscode调试redis7源码环境搭建

##vscode launch.json配置文件

cpp 复制代码
{
    // 使用 IntelliSense 了解相关属性。 
    // 悬停以查看现有属性的描述。
    // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "启动 redis",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceFolder}/src/redis-server",
            "args": ["redis.conf"],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "为 gdb 启用整齐打印",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                },
                {
                    "description": "将反汇编风格设置为 Intel",
                    "text": "-gdb-set disassembly-flavor intel",
                    "ignoreFailures": true
                }
            ],
            "preLaunchTask": "build-redis",
            //"miDebuggerArgs": "-q -ex quit; wait() { fg >/dev/null; }; /bin/gdb -q --interpreter=mi"
            "miDebuggerPath": "/usr/bin/gdb"
        }
    ]
}

##vscode tasks.json配置文件

cpp 复制代码
{
    "tasks": [
        {
            "type": "cppbuild",
            "label": "build-redis",
            "command": "/usr/bin/make",
            "args": [
            ],
            "options": {
                "cwd": "${workspaceFolder}"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "detail": "调试器生成的任务。"
        }
    ],
    "version": "2.0.0"
}

##vscode 打开redis-7.0.4源码

##点击运行启动redis7源码debug调试

相关推荐
暮冬-  Gentle°2 分钟前
C++中的命令模式实战
开发语言·c++·算法
㓗冽3 小时前
分解质因数-进阶题10
c++
图图的点云库3 小时前
高斯滤波实现算法
c++·算法·最小二乘法
CoderCodingNo4 小时前
【GESP】C++七级考试大纲知识点梳理, (1) 数学库常用函数
开发语言·c++
老鱼说AI5 小时前
CUDA架构与高性能程序设计:异构数据并行计算
开发语言·c++·人工智能·算法·架构·cuda
czlczl200209255 小时前
Redis命令处理逻辑模型
数据库·redis·缓存
摇滚侠5 小时前
JAVA 项目教程《黑马商城-Redis 篇》,分布式架构项目,从开发到部署
java·redis·分布式
zhang2008l6 小时前
redis连接服务
数据库·redis·bootstrap
一个有温度的技术博主6 小时前
Redis系列二:认识Redis
数据库·redis·缓存
2301_793804697 小时前
C++中的适配器模式变体
开发语言·c++·算法