gdb optimized out错误解决


 转自:http://blog.csdn.net/cws1214/article/details/12023093

 

when linux gdb debug, print a variable, such as i,  by command p i;

 

The gdb output  value optimized out.

 

The solution for the problem is off the compile optimation option -Ox,  x note digital, such 2, 3, 4 etc

 

The better way is that changing -Ox to -O0.

The -O0 denotes there is no optimization. It will avoid gdb mislead source code line issue.


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM