乐趣区

关于redis:vscode-查看Redis源码

简介

最近在学习 Redis 源码,次要是目前负责华为产品 FusionInsight HD 中 Redis 组件的相干事务,不得不学习 Redis 源码。本文次要讲述的是怎么通过 vscode 查看 Redis 的源码 (Linux 平台上面).

配置

在我的项目上面减少文件夹 .vscode,并且新建文件:launch.jsontasks.jsonc_cpp_properties.json,并且在文件中增加上面内容:

launch.json:

{
    "version": "0.2.0",
    "configurations": [
  
        {
            "name": "build",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceFolder}/src/redis-server",
            "args": ["redis.conf"],
            "stopAtEntry": true,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "preLaunchTask": "shell"
        }
    ]
}

tasks.json:

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "shell",
            "type": "shell",
            "command": "/usr/bin/make"
        }
    ]
}

c_cpp_properties.json

{
    "configurations": [
        {
            "name": "Linux",
            "includePath": ["${workspaceFolder}/**"
            ],
            "defines": [],
            "compilerPath": "/usr/bin/clang",
            "cStandard": "c11",
            "cppStandard": "c++14",
            "intelliSenseMode": "clang-x64"
        }
    ],
    "version": 4
}

运行

应用快捷键 F5 进行编译调试。

标 题:《vscode 查看 Redis 源码》
作 者:zeekling
提 示:转载请注明文章转载自集体博客:小令童鞋

退出移动版