詳細(xì)參考
http://www.reibang.com/p/b4c34ee9e411
Mac補充關(guān)于libevent的安裝
brew install libevent
編寫編譯腳本
#!/bin/bash
# 顯示執(zhí)行該指令及所下的參數(shù)危号。
set -x
# clean 整個工程
make clean
OUTPUT=$(pwd)/bin
# 編譯函數(shù)
function build
{
# 編譯前清理數(shù)據(jù)
make clean
./configure \
--prefix=$OUTPUT/ \
--CPPFLAGS='-lldb'
# 編譯。
make -j8
#安裝
make install
echo -e "\033[32m build successful \033[0m"
}
#執(zhí)行編譯命令
build
調(diào)試memcached
調(diào)試腳本
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "debug memcached",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/bin/bin/memcached",
"args": ["-p", "11211", "-m", "64m", "-d"],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "lldb"
}
]
}
調(diào)試效果
memcached.jpg