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调试

相关推荐
tod1133 分钟前
Redis 分布式锁进阶:从看门狗到 Redlock 的高可用实践
数据库·redis·分布式
mjhcsp7 分钟前
C++区间 DP解析
开发语言·c++
闲人编程8 分钟前
Celery分布式任务队列
redis·分布式·python·celery·任务队列·异步化
danyang_Q18 分钟前
vscode python-u问题
开发语言·vscode·python
xiaoye-duck29 分钟前
《算法题讲解指南:优选算法-双指针》--05有效三角形的个数,06查找总价值为目标值的两个商品
c++·算法
ArturiaZ32 分钟前
【day31】
开发语言·c++·算法
xiaoye-duck36 分钟前
《算法题讲解指南:优选算法-双指针》--07三数之和,08四数之和
c++·算法
渣瓦攻城狮40 分钟前
互联网大厂Java面试:Spring、微服务与消息队列技术详解
java·redis·spring·微服务·消息队列·面试指南·程序员面试
daxi1501 小时前
C语言从入门到进阶——第8讲:VS实用调试技巧
c语言·开发语言·c++·算法·蓝桥杯
玄〤1 小时前
个人博客网站搭建day2-Spring Boot 3 + JWT + Redis 实现后台权限拦截与单点登录(漫画解析)
java·spring boot·redis·后端·jwt