gdb value optimized out

转自:http://blog.csdn.net/fanbird2008/article/details/6399630

gdb value optimized out

  3873人阅读  评论(1)  收藏  举报
command output linux

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.

你可能感兴趣的:(gdb value optimized out)