gdb <value optimized out>

Andreas Pakulat apaku at gmx.de
Mon Dec 13 08:12:39 GMT 2010


On 11.12.10 16:59:27, G VM wrote:
> 
> Hi all,
> 
> I have been searching for a solution for my problem but unfortunately I didn't find a solution.
> 
> Problem:
> When I start my compiled program with gdb and want to print the value of an integer (probably other data types as well) I get the message <value optimized out>.
> I am a gentoo user so I am aware that -O exists.
> So I went searching in KDevelop on how to configure this.
> 
> I changed some flags in the "Open Options", "Advanced settings" to use -O0.
> 
> CMAKE_CXX_FLAGS
> 
> CMAKE_CXX_FLAGS_DEBUG
> 
> CMAKE_C_FLAGS
> 
> CMAKE_C_FLAGS_DEBUG
> ...
> 
> And on the kdevelop forum I found a thread which mentioned using -g3 as well.
> I did this, cleaned and recompiled the program. But still I have the same result.
> 
> I really have no clue anymore what I am doing wrong.
> Anyone has an idea about this?
> 
> I use:
> 
> 
> Version 4.0.2 (using KDevPlatform 1.0.2)
> Using KDE Development Platform 4.4.5 (KDE 4.4.5)
> Program I want to compile to debug is Krdc.

Then use "debugfull" as CMake Build Type, thats a special one provided
by FindKDE4Internal.cmake and sets -O0 -g3 explicitly. The
FindKDE4Internal.cmake file is also the culprit of setting -O2 -g in the
cmake commandline. Unfortunately whoever wrote that piece implemented it
in a way that it always overwrites whats set in the cache...

Andreas

-- 
You will feel hungry again in another hour.




More information about the KDevelop mailing list