转自: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.

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-20
  • 2021-06-28
猜你喜欢
  • 2022-12-23
  • 2021-08-04
  • 2022-12-23
  • 2021-11-20
  • 2021-12-18
  • 2022-12-23
相关资源
相似解决方案