vscode 查看Redis源碼

簡(jiǎn)介
最近在學(xué)習Redis源碼,主要是目前負責華為產(chǎn)品FusionInsight HD中Redis組件的相關(guān)事務(wù),不得不學(xué)習Redis源碼。本文主要講述的是怎么通過(guò)vscode查看Redis的源碼(Linux平臺下面).
配置
在項目下面增加文件夾 .vscode,并且新建文件:launch.json 、tasks.json、 c_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進(jìn)行編譯調試。
評論
0 評論