vscode调试redis
系统:ubuntu
redis:redis-6.0.3
1.在vs中安装c/c++编译插件
2.用vscode打开redis-6.0.3
3.在菜单中找到run->Add Configuration…
4.会在目录中生成一个./vscode目录,里面包含launch.json,修改launch.json中的program:${workspaceFolder}/src/redis-server
5.在./vscode目录下新建tasks.json
{
"version": "2.0.0",
"tasks": [
{
"label": "Build",
"type": "shell",
"command": "make",
"args": [
"CFLAGS="-g -O0""
]
}
]
}
6.找到redis的入口server.c/main打上断点,F5允许调试。
更多讲解,欢迎关注我的github:
go成神之路