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

相关推荐
froyoisle6 分钟前
CSP 真题解析:[CSP-J 2020-T3] 表达式
c++·算法·csp·信息学·信奥赛
Darkwanderor15 分钟前
动、静态库相关内容的详细介绍
linux·c语言·开发语言·c++
文祐18 分钟前
C++类之虚函数表没有虚继承的菱形继承
开发语言·c++·算法
孬甭_2 小时前
C++ string类
开发语言·c++
万亿少女的梦1682 小时前
基于微信小程序、Spring Boot与Vue3的智慧养老管理系统设计与实现
spring boot·redis·微信小程序·mybatis·vue3
盐焗鹌鹑蛋3 小时前
【C++】C++11:右值引用、移动语义万能引用
c++
LingzhiPi3 小时前
零知ESP32--RC522NFC考勤打卡系统
c++·单片机·嵌入式硬件
小灰灰搞电子4 小时前
C++ boost::range 详解:基于最新版本的现代范围处理指南
开发语言·c++
王燕龙(大卫)4 小时前
fastdds笔记
网络·c++·笔记
蚰蜒螟4 小时前
从 Jedis 到内核:深入剖析 Redis BRPOP 的阻塞与唤醒机制
数据库·redis·缓存