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

相关推荐
AndreasEmil1 小时前
JavaSE - 继承
java·开发语言·ide·vscode·intellij-idea·idea
liulilittle8 小时前
FileStream C++
开发语言·c++·cocoa
Gomiko8 小时前
C/C++基础(五):分支
c语言·c++
点PY8 小时前
C++ 中 std::async 和 std::future 的并发性
java·开发语言·c++
不会代码的小猴8 小时前
C++的第九天笔记
开发语言·c++·笔记
fqbqrr9 小时前
2512C++,clangd支持模块
开发语言·c++
老王熬夜敲代码10 小时前
C++中的thread
c++·笔记·面试
qq_4798754311 小时前
C++ 鸭子类型” (Duck Typing)
开发语言·c++
崇山峻岭之间11 小时前
C++ Prime Plus 学习笔记033
c++·笔记·学习
暗然而日章11 小时前
C++基础:Stanford CS106L学习笔记 7 类
c++·笔记·学习