gdb无法单步调试

使用gdb调试单步程序时如果打印提示“single stepping until exit from function xxx,which has no line number information”,可能的原因有两个:

1 编译源文件时没有加-g选项;

2 gcc与gdb版本不兼容,通常是由于手工对gcc程序进行了升级,导致现有gdb程序版本过旧,比如gcc升级到4.8版本,gdb仍为旧的7.2版本。此时需要下载新版gdb源码包(7.8版本可行),手工升级gdb。

./configure
make & make install
cp -fv ./gdb/gdb /usr/bin/

 

posted @ 2017-03-24 22:46  chysu  阅读(5377)  评论(0编辑  收藏  举报