使用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/