linux安装cgdb

下载完cgdb之后,进入cgdb目录,执行:

$ ./configure --prefix=/usr/local
$ make
$ sudo make install

 

在第一步出现如下错误,则按下面方法解决:

出现错误:
configure: error: CGDB requires curses.h or ncurses/curses.h to build.
解决方案:
yum install ncurses-devel


出现错误:
configure: error: Please install makeinfo before installing
解决方案:
yum install texinfo

如果是 CentOS 8.0 及以上系统,需要先执行:

yum config-manager --set-enabled PowerTools 


出现错误:
configure: error: Please install help2man
解决方案:
yum install help2man


出现错误:
configure: error: CGDB requires GNU readline 5.1 or greater to link.
  If you used --with-readline instead of using the system readline library,
  make sure to set the correct readline library on the linker search path
  via LD_LIBRARY_PATH or some other facility.
解决方案:
yum install readline-devel


出现错误:
configure: error: Please install flex before installing
解决方案:
yum install flex

 

安装好了以后,输入"cgdb 要调试的程序名“即可以进行调试,比如我这里调试mysql源码:

 

 

zhangyl 2016.11.30日补充:

cgdb不足之处:
cgdb中调用gdb的print命令无法显示字符串类型中的中文字符,要么显示乱码,要么不显示,这给程序调试带来了很大的困扰。
这点需要注意!!!

评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值