<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
I just tried compiling using the CMAKE_CXX_FLAGS_DEBUG -ggdb -O0.<br>However I still get <value optimized out>.<br><br>I want to debug the krdc project.<br><br>CMAKE_BUILD_TYPE is set to Debug ;) (I selected it when importing the sources).<br><br>This is really frustrating :S<br><br>As an off topic question: I compiled modified source files to .so files and I want those to be used when I execute the main executable. Now the installed ones are used :S<br><br>Thanks for your answers though! I appreciate your efforts!<br><br>> From: radub82@gmail.com<br>> To: kdevelop@kdevelop.org<br>> Subject: Re: gdb <value optimized out><br>> Date: Mon, 13 Dec 2010 02:17:13 +0200<br>> <br>> Oh and you could try another way. If you right click your project and select <br>> configuration, under CMake you can find CMAKE_BUILD_TYPE.<br>> you can change between Release and Debug or RelWithDebugInfo there.<br>> <br>> On Monday, December 13, 2010 02:05:41 G VM wrote:<br>> > I got a step further.<br>> > It seems that both -g3 -O0 and -g -O2 are in the c++ compilation lines<br>> > (make -n). So the second take priority over the first.<br>> > <br>> > However I still can't understand were those -g and -O2 are configured.<br>> > The CMAKE_CXX_FLAGS_DEBUG and CMAKE_CXX_FLAGS don't have these.<br>> > <br>> > If I do a grep for -O2 and remove those, and then do make all works as it<br>> > should.<br>> > <br>> > touch rdp/rdpview.cpp<br>> > cd build<br>> > make -p | grep rdpview<br>> > <br>> > 1.<br>> > rdp/CMakeFiles/krdc_rdpplugin.dir/rdpview.o: ../rdp/rdpview.cpp<br>> > ../core/hostpreferences.h ../core/remoteview.h ../rdp/rdphostpreferences.h<br>> > ../rdp/rdpview.cpp ../rdp/rdpview.h /usr/include/KDE/../kdialog.h<br>> > /usr/include/KDE/../kinputdialog.h /usr/include/KDE/../kmessagebox.h<br>> > /usr/include/KDE/../kpassworddialog.h /usr/include/KDE/../kshell.h<br>> > /usr/include/KDE/../kurl.h /usr/include/KDE/KDialog<br>> > /usr/include/KDE/KInputDialog /usr/include/KDE/KMessageBox<br>> > /usr/include/KDE/KPasswordDialog /usr/include/KDE/KShell<br>> > /usr/include/KDE/KUrl /usr/include/KDE/KWallet/../../kwallet.h<br>> > /usr/include/KDE/KWallet/Wallet /usr/include/qt4/Gentoo/gentoo-qconfig.h<br>> > /usr/include/qt4/Qt3Support/q3cstring.h<br>> > /usr/include/qt4/Qt3Support/q3valuelist.h /usr/include/qt4/QtCore/QEvent<br>> > /usr/include/qt4/QtCore/QFlags /usr/include/qt4/QtCore/QMap<br>> > /usr/include/qt4/QtCore/QObject /usr/include/qt4/QtCore/QPoint<br>> > /usr/include/qt4/QtCore/QPointF /usr/include/qt4/QtCore/QProcess<br>> > /usr/include/qt4/QtCore/QSize /usr/include/qt4/QtCore/QStringList<br>> > /usr/include/qt4/QtCore/QUrl /usr/include/qt4/QtCore/QVariant<br>> > /usr/include/qt4/QtCore/qabstractitemmodel.h<br>> > /usr/include/qt4/QtCore/qalgorithms.h /usr/include/qt4/QtCore/qatomic.h<br>> > /usr/include/qt4/QtCore/qatomic_alpha.h<br>> > /usr/include/qt4/QtCore/qatomic_arch.h<br>> > /usr/include/qt4/QtCore/qatomic_arm.h<br>> > /usr/include/qt4/QtCore/qatomic_armv6.h<br>> > /usr/include/qt4/QtCore/qatomic_avr32.h<br>> > /usr/include/qt4/QtCore/qatomic_bfin.h<br>> > /usr/include/qt4/QtCore/qatomic_bootstrap.h<br>> > /usr/include/qt4/QtCore/qatomic_generic.h<br>> > /usr/include/qt4/QtCore/qatomic_i386.h<br>> > /usr/include/qt4/QtCore/qatomic_ia64.h<br>> > /usr/include/qt4/QtCore/qatomic_macosx.h<br>> > /usr/include/qt4/QtCore/qatomic_mips.h<br>> > /usr/include/qt4/QtCore/qatomic_parisc.h<br>> > /usr/include/qt4/QtCore/qatomic_powerpc.h<br>> > /usr/include/qt4/QtCore/qatomic_s390.h<br>> > /usr/include/qt4/QtCore/qatomic_sh.h<br>> > /usr/include/qt4/QtCore/qatomic_sh4a.h<br>> > /usr/include/qt4/QtCore/qatomic_sparc.h<br>> > /usr/include/qt4/QtCore/qatomic_symbian.h<br>> > /usr/include/qt4/QtCore/qatomic_vxworks.h<br>> > /usr/include/qt4/QtCore/qatomic_x86_64.h<br>> > /usr/include/qt4/QtCore/qbasicatomic.h /usr/include/qt4/QtCore/qbuffer.h<br>> > /usr/include/qt4/QtCore/qbytearray.h /usr/include/qt4/QtCore/qchar.h<br>> > /usr/include/qt4/QtCore/qconfig.h<br>> > /usr/include/qt4/QtCore/qcoreapplication.h<br>> > /usr/include/qt4/QtCore/qcoreevent.h /usr/include/qt4/QtCore/qdatastream.h<br>> > /usr/include/qt4/QtCore/qeventloop.h /usr/include/qt4/QtCore/qfeatures.h<br>> > /usr/include/qt4/QtCore/qglobal.h /usr/include/qt4/QtCore/qhash.h<br>> > /usr/include/qt4/QtCore/qiodevice.h /usr/include/qt4/QtCore/qiterator.h<br>> > /usr/include/qt4/QtCore/qline.h /usr/include/qt4/QtCore/qlinkedlist.h<br>> > /usr/include/qt4/QtCore/qlist.h /usr/include/qt4/QtCore/qlocale.h<br>> > /usr/include/qt4/QtCore/qmap.h /usr/include/qt4/QtCore/qmargins.h<br>> > /usr/include/qt4/QtCore/qmetatype.h /usr/include/qt4/QtCore/qmimedata.h<br>> > /usr/include/qt4/QtCore/qnamespace.h /usr/include/qt4/QtCore/qobject.h<br>> > /usr/include/qt4/QtCore/qobjectdefs.h /usr/include/qt4/QtCore/qpair.h<br>> > /usr/include/qt4/QtCore/qpoint.h /usr/include/qt4/QtCore/qpointer.h<br>> > /usr/include/qt4/QtCore/qprocess.h /usr/include/qt4/QtCore/qrect.h<br>> > /usr/include/qt4/QtCore/qregexp.h /usr/include/qt4/QtCore/qscopedpointer.h<br>> > /usr/include/qt4/QtCore/qset.h /usr/include/qt4/QtCore/qshareddata.h<br>> > /usr/include/qt4/QtCore/qsharedpointer.h<br>> > /usr/include/qt4/QtCore/qsharedpointer_impl.h<br>> > /usr/include/qt4/QtCore/qsize.h /usr/include/qt4/QtCore/qstring.h<br>> > /usr/include/qt4/QtCore/qstringbuilder.h<br>> > /usr/include/qt4/QtCore/qstringlist.h<br>> > /usr/include/qt4/QtCore/qstringmatcher.h /usr/include/qt4/QtCore/qurl.h<br>> > /usr/include/qt4/QtCore/qvariant.h /usr/include/qt4/QtCore/qvector.h<br>> > /usr/include/qt4/QtGui/QAction /usr/include/qt4/QtGui/QApplication<br>> > /usr/include/qt4/QtGui/QButtonGroup /usr/include/qt4/QtGui/QCheckBox<br>> > /usr/include/qt4/QtGui/QDialog /usr/include/qt4/QtGui/QFormLayout<br>> > /usr/include/qt4/QtGui/QGroupBox /usr/include/qt4/QtGui/QHBoxLayout<br>> > /usr/include/qt4/QtGui/QHeaderView /usr/include/qt4/QtGui/QLabel<br>> > /usr/include/qt4/QtGui/QLayout /usr/include/qt4/QtGui/QMessageBox<br>> > /usr/include/qt4/QtGui/QSpacerItem /usr/include/qt4/QtGui/QSpinBox<br>> > /usr/include/qt4/QtGui/QVBoxLayout /usr/include/qt4/QtGui/QWidget<br>> > /usr/include/qt4/QtGui/QX11EmbedContainer<br>> > /usr/include/qt4/QtGui/qabstractbutton.h<br>> > /usr/include/qt4/QtGui/qabstractitemdelegate.h<br>> > /usr/include/qt4/QtGui/qabstractitemview.h<br>> > /usr/include/qt4/QtGui/qabstractscrollarea.h<br>> > /usr/include/qt4/QtGui/qabstractslider.h<br>> > /usr/include/qt4/QtGui/qabstractspinbox.h /usr/include/qt4/QtGui/qaction.h<br>> > /usr/include/qt4/QtGui/qactiongroup.h<br>> > /usr/include/qt4/QtGui/qapplication.h /usr/include/qt4/QtGui/qboxlayout.h<br>> > /usr/include/qt4/QtGui/qbrush.h /usr/include/qt4/QtGui/qbuttongroup.h<br>> > /usr/include/qt4/QtGui/qcheckbox.h /usr/include/qt4/QtGui/qcolor.h<br>> > /usr/include/qt4/QtGui/qcursor.h /usr/include/qt4/QtGui/qdesktopwidget.h<br>> > /usr/include/qt4/QtGui/qdialog.h /usr/include/qt4/QtGui/qdrag.h<br>> > /usr/include/qt4/QtGui/qevent.h /usr/include/qt4/QtGui/qfont.h<br>> > /usr/include/qt4/QtGui/qfontinfo.h /usr/include/qt4/QtGui/qfontmetrics.h<br>> > /usr/include/qt4/QtGui/qformlayout.h /usr/include/qt4/QtGui/qframe.h<br>> > /usr/include/qt4/QtGui/qgridlayout.h /usr/include/qt4/QtGui/qgroupbox.h<br>> > /usr/include/qt4/QtGui/qheaderview.h /usr/include/qt4/QtGui/qicon.h<br>> > /usr/include/qt4/QtGui/qimage.h<br>> > /usr/include/qt4/QtGui/qitemselectionmodel.h<br>> > /usr/include/qt4/QtGui/qkeysequence.h /usr/include/qt4/QtGui/qlabel.h<br>> > /usr/include/qt4/QtGui/qlayout.h /usr/include/qt4/QtGui/qlayoutitem.h<br>> > /usr/include/qt4/QtGui/qmacdefines_mac.h /usr/include/qt4/QtGui/qmatrix.h<br>> > /usr/include/qt4/QtGui/qmessagebox.h /usr/include/qt4/QtGui/qmime.h<br>> > /usr/include/qt4/QtGui/qpaintdevice.h<br>> > /usr/include/qt4/QtGui/qpainterpath.h /usr/include/qt4/QtGui/qpalette.h<br>> > /usr/include/qt4/QtGui/qpixmap.h /usr/include/qt4/QtGui/qpolygon.h<br>> > /usr/include/qt4/QtGui/qregion.h /usr/include/qt4/QtGui/qrgb.h<br>> > /usr/include/qt4/QtGui/qrubberband.h /usr/include/qt4/QtGui/qsizepolicy.h<br>> > /usr/include/qt4/QtGui/qslider.h /usr/include/qt4/QtGui/qspinbox.h<br>> > /usr/include/qt4/QtGui/qstyle.h /usr/include/qt4/QtGui/qstyleoption.h<br>> > /usr/include/qt4/QtGui/qtabbar.h /usr/include/qt4/QtGui/qtabwidget.h<br>> > /usr/include/qt4/QtGui/qtransform.h<br>> > /usr/include/qt4/QtGui/qtransportauth_qws.h<br>> > /usr/include/qt4/QtGui/qvalidator.h /usr/include/qt4/QtGui/qwidget.h<br>> > /usr/include/qt4/QtGui/qwindowdefs.h<br>> > /usr/include/qt4/QtGui/qwindowdefs_win.h /usr/include/qt4/QtGui/qwmatrix.h<br>> > /usr/include/qt4/QtGui/qx11embed_x11.h /usr/include/qt4/QtXml/QDomDocument<br>> > /usr/include/qt4/QtXml/qdom.h core/settings.h rdp/../../rdp/rdpview.h<br>> > rdp/rdpview.moc rdp/ui_rdppreferences.h<br>> > rdp/CMakeFiles/krdc_rdpplugin.dir/flags.make 2.<br>> > # Implicit rule search has not been done.<br>> > 3.<br>> > # Modification time never checked.<br>> > 4.<br>> > # File has not been updated.<br>> > 5.<br>> > # commands to execute (from<br>> > `rdp/CMakeFiles/krdc_rdpplugin.dir/build.make', line 126): 6.<br>> > $(CMAKE_COMMAND) -E cmake_progress_report<br>> > /home/xxx/kdenetwork-4.4.5/krdc/build/CMakeFiles $(CMAKE_PROGRESS_4) 7.<br>> > @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR)<br>> > --green "Building CXX object rdp/CMakeFiles/krdc_rdpplugin.dir/rdpview.o"<br>> > 8.<br>> > cd /home/xxx/kdenetwork-4.4.5/krdc/build/rdp && /usr/bin/c++ <br>> > $(CXX_DEFINES) $(CXX_FLAGS) -o CMakeFiles/krdc_rdpplugin.dir/rdpview.o -c<br>> > /home/xxx/kdenetwork-4.4.5/krdc/rdp/rdpview.cpp<br>> > <br>> > <br>> > Vi rdp/CMakeFiles/krdc_rdpplugin.dir/flags.make<br>> > # CMAKE generated file: DO NOT EDIT!<br>> > # Generated by "Unix Makefiles" Generator, CMake Version 2.8<br>> > <br>> > # compile CXX with /usr/bin/c++<br>> > CXX_FLAGS = -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align<br>> > -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat-security<br>> > -fno-exceptions -DQT_NO_EXCEPTIONS -fno-check-new -fno-common<br>> > -Woverloaded-virtual -fno-threadsafe-statics -fvisibility=hidden<br>> > -fvisibility-inlines-hidden -g -O2 -fno-reorder-blocks -fno-schedule-insns<br>> > -fno-inline -fPIC -I/home/xxx/kdenetwork-4.4.5/krdc/build/rdp<br>> > -I/home/xxx/kdenetwork-4.4.5/krdc/rdp -I/home/xxx/kdenetwork-4.4.5/krdc<br>> > -I/home/xxx/kdenetwork-4.4.5/krdc/build<br>> > -I/home/xxx/kdenetwork-4.4.5/krdc/core<br>> > -I/home/xxx/kdenetwork-4.4.5/krdc/build/core -I/usr/include/KDE<br>> > -I/usr/include/qt4/QtXmlPatterns -I/usr/include/qt4/QtXml<br>> > -I/usr/include/qt4/QtWebKit -I/usr/include/qt4/QtUiTools<br>> > -I/usr/include/qt4/QtTest -I/usr/include/qt4/QtSvg<br>> > -I/usr/include/qt4/QtSql -I/usr/include/qt4/QtScriptTools<br>> > -I/usr/include/qt4/QtScript -I/usr/include/qt4/QtOpenGL<br>> > -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtHelp<br>> > -I/usr/include/qt4/QtDesigner -I/usr/include/qt4/QtDBus<br>> > -I/usr/include/qt4/QtAssistant -I/usr/include/qt4/Qt3Support<br>> > -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtCore -I/usr/include/qt4/Qt<br>> > -I/usr/share/qt4/mkspecs/default -I/usr/include/qt4 -D_GNU_SOURCE<br>> > -D_LARGEFILE64_SOURCE<br>> > <br>> > CXX_DEFINES = -DMAKE_KRDC_RDPPLUGIN_LIB -D_BSD_SOURCE -D_XOPEN_SOURCE=500<br>> > -D_BSD_SOURCE -DQT_NO_STL -DQT_NO_CAST_TO_ASCII -D_REENTRANT<br>> > -DKDE_DEPRECATED_WARNINGS -DKDE_DEFAULT_DEBUG_AREA=5012<br>> > <br>> > So here it is already set.<br>> > <br>> > Hopefuly this helps finding the cause.<br>> > <br>> > From: drums_gvm@hotmail.com<br>> > To: kdevelop@kdevelop.org<br>> > Subject: gdb <value optimized out><br>> > Date: Sat, 11 Dec 2010 16:59:27 +0100<br>> > <br>> > <br>> > <br>> > <br>> > <br>> > <br>> > <br>> > <br>> > Hi all,<br>> > <br>> > I have been searching for a solution for my problem but unfortunately I<br>> > didn't find a solution.<br>> > <br>> > Problem:<br>> > When I start my compiled program with gdb and want to print the value of an<br>> > integer (probably other data types as well) I get the message <value<br>> > optimized out>. I am a gentoo user so I am aware that -O exists.<br>> > So I went searching in KDevelop on how to configure this.<br>> > <br>> > I changed some flags in the "Open Options", "Advanced settings" to use -O0.<br>> > <br>> > CMAKE_CXX_FLAGS<br>> > <br>> > CMAKE_CXX_FLAGS_DEBUG<br>> > <br>> > CMAKE_C_FLAGS<br>> > <br>> > CMAKE_C_FLAGS_DEBUG<br>> > ...<br>> > <br>> > And on the kdevelop forum I found a thread which mentioned using -g3 as<br>> > well. I did this, cleaned and recompiled the program. But still I have the<br>> > same result.<br>> > <br>> > I really have no clue anymore what I am doing wrong.<br>> > Anyone has an idea about this?<br>> > <br>> > I use:<br>> > <br>> > <br>> > Version 4.0.2 (using KDevPlatform 1.0.2)<br>> > Using KDE Development Platform 4.4.5 (KDE 4.4.5)<br>> > Program I want to compile to debug is Krdc.<br>> > <br>> > Thanks in advance for your help!<br>> > <br>> > <br>> > _______________________________________________<br>> > kdevelop mailing list<br>> > kdevelop@kdevelop.org<br>> > https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop<br>> <br>> _______________________________________________<br>> kdevelop mailing list<br>> kdevelop@kdevelop.org<br>> https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop<br> </body>
</html>