在ubuntu下用eclipse-cdt调试memcached

最近总是要看看memcached的代码,虽然以前也是作c/c++的,可是这几年用惯eclipse,已经不习惯用vi看代码了。研究一下,用eclipse-cdt debug memcached,现在方便多了。
[img]http://www.iteye.com/upload/attachment/44572/791e23b6-cf31-34d4-bbe6-6ff8d3c30002.png[/img]

1. 解压代码

cd dev
tar zxvf memcached-1.2.6-tar.gz



2. configure

cd memcached-1.2.6
./configure --enable-threads


3. 新建一个C project
[img]http://uniseraph.iteye.com/upload/attachment/44658/0b395de8-8a0f-324d-83e3-501905856c39.png[/img]

4. import 代码到project中
[img]http://uniseraph.iteye.com/upload/attachment/44674/f3c29ec5-c36a-36b3-8df1-0616e39a8f84.png[/img]
[img]http://uniseraph.iteye.com/upload/attachment/44668/088941c8-927e-39fb-bb1f-aa3b547ee3c1.png[/img]


5. 创建一个target : all
[img]http://uniseraph.iteye.com/upload/attachment/44660/6ea84b8b-a770-3c44-9dfe-bcd97fe99488.png[/img]

6. 配置编译参数HAVE_CONFIG_H
[img]http://uniseraph.iteye.com/upload/attachment/44662/9c62d5fb-efec-325a-b26f-0a111accf0d6.png[/img]

7. 配置include
[img]http://uniseraph.iteye.com/upload/attachment/44670/6162f146-0860-33b1-9bb1-70290c505805.png[/img]

8. 配置libraryies
[img]http://uniseraph.iteye.com/upload/attachment/44672/f01feb7d-3a85-3a19-b7af-8445ce5674f0.png[/img]

9. 在memcached.c的main函数中加一个断点,选择“local c/c++ application” debug
[img]http://uniseraph.iteye.com/upload/attachment/44664/fd81cddc-bdc5-30cb-bdaa-dd886a7a3c3b.png[/img]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值