How to solve gdb <value optimized out> problem?
Andi Hellmund
mail@andihellmund.com
Fri May 28 07:17:00 GMT 2010
Andi Hellmund wrote:
> Hey,
>
>> I am trying debug gcc 4.5.0 use gdb on ubuntu
>>
>> and encounter the problem by seeing "value optimized out". as fellow:
>
> Did you get this behavior even with the -O0 GCC build? Basically, GDB
> tells you what's wrong with the executable. For a short explanation, check
> this page (http://www.cs.utk.edu/~vose/c-stuff/onlinedocs/gdb_7.html) and
> search for "value optimized out".
>
> I made the experience that using -O0 shouldn't produce the "value
> optimized out" problem, because the code is not optimized.
>
> Andi
>
BTW, this GCC-wiki page summarizes the most-important aspects of
GCC-debugging:
http://gcc.gnu.org/wiki/DebuggingGCC
More information about the Gcc-help
mailing list