Re: very strange behaviour
Did you check the value during runtime? Maybe there it is true and not false? Maybe you have some uninitialised variable somewhere which causes a random value during runtime and is zeroed while under debugger?
Re: very strange behaviour
heh, I hate when physics is broken. :p
maybe the executable code is out of sync? do a full clean rebuild? maybe the wrong dll/debug symbols is being loaded?
maybe there's a background thread running? but that would take some really weird timing.
can you look at the assembly code that is being run? maybe that might give a hint.
Re: very strange behaviour
Thanks for replying,
I have put a qDebug() statement in the method, but that doesn't show up in the output also.
It seems as my code is getting randomly executed. I will check for the variables to see if they are all initialized. About the assemblycode: How does one look at the assemblycode?
Rgx
Re: very strange behaviour
Quote:
Originally Posted by regix
I have put a qDebug() statement in the method, but that doesn't show up in the output also.
Is the application compiled in debug mode?
Re: very strange behaviour
No, in Release mode with Enable warnings,
should I compile it in Debug mode?
Re: very strange behaviour
I changed the project options in kdevelop to compile in debug mode
g++ -c -pipe -O2 -march=i586 -mtune=i686 -fmessage-length=0 -Wall -D_FORTIFY_SOURCE=2 -g -Wall -W -g -DQT_SHARED -DQT_TABLET_SUPPORT -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -I/usr/lib/qt3/mkspecs/default -I. -I/usr/include/Magick++ -I/usr/include/magick -I/usr/include -I/usr/lib/qt3/include -o dlgtexteffect.o dlgtexteffect.cpp
this is part of the output: it seems to me that NO_DEBUG is still active and the application is still build in release mode??
Rgx
Re: very strange behaviour
LOL, I'm surprised you could even step through code in release mode.
Re: very strange behaviour
Quote:
Originally Posted by regix
this is part of the output: it seems to me that NO_DEBUG is still active and the application is still build in release mode??
If you didn't forget to run qmake after the change in the project file, then it's ok. How does the application behave now? Can you, for example set a breakpoint in the troublesome code and step through it monitoring the behaviour?
Re: very strange behaviour
Code:
# File generated by kdevelop's qmake manager.
# -------------------------------------------
# Subdir relative project main directory: ./src
# Target is an application:
LIBS += -lMagick \
-lMagick++
INCLUDEPATH += /usr/include/Magick++ \
/usr/include/magick
CONFIG += debug \
warn_on \
qt
TEMPLATE = app
FORMS += backgrounddlg.ui \
CreateDialogBase.ui \
dlgCSS.ui \
dlgTextEffectBase.ui \
dlgTextForAllBase.ui \
EditCSSDlgBase.ui \
MagickFontDlg.ui \
ThemeBase.ui \
websitedialog.ui
HEADERS += BackGroundDlgImpl.h \
createdialog.h \
css.h \
dlgcssimpl.h \
dlgtexteffect.h \
dlgtextforall.h \
editcssdlg.h \
htmlgenerator.h \
htmlpage.h \
listviewbackground.h \
magickfontdlgimpl.h \
mysettings.h \
myspeciallabel.h \
mystatuslabel.h \
saxhandler.h \
texteffect.h \
theme.h \
themeimpl.h \
thumbnailgenerator.h \
websitedialogimpl.h
SOURCES += BackGroundDlgImpl.cpp \
createdialog.cpp \
css.cpp \
dlgcssimpl.cpp \
dlgtexteffect.cpp \
dlgtextforall.cpp \
editcssdlg.cpp \
htmlgenerator.cpp \
htmlpage.cpp \
listviewbackground.cpp \
magickfontdlgimpl.cpp \
mysettings.cpp \
myspeciallabel.cpp \
mystatuslabel.cpp \
saxhandler.cpp \
texteffect.cpp \
theme.cpp \
themeimpl.cpp \
thumbnailgenerator.cpp \
websitecreator.cpp \
websitedialogimpl.cpp
This is my .pro file.
I ran qmake followed by make.
Although debug is marked in the pro file during compilation g++ uses -D NO_DEBUG
I am able to put a breakpoint in the sourcecode but unable to debug it.
Rgx
Re: very strange behaviour
After a second look:
I am actually able to debug the application. It just didnt stop at the second breakpoint. As I can see now several of my bool variables have a numerical value???
I will have a look at the constructor where I give a value to them.
Rgx
:o
Re: very strange behaviour
I dont understand how that code evne compiles, since when is
Code:
if (condition1 and condition2) {}
valid C++ ?
I thought it should be
Code:
if (condition1 && condition2) {}
Re: very strange behaviour
yes I know, I've tried both and it looks that both compile. The strange thing about my code is: I put a QMessageBox statement in a constructor that gets executed and the code compiles but doesn't get executed. Nothing I change in the code gets executed!!!
It's driving me nuts!
Rgx:eek: :eek:
Re: very strange behaviour
Try cleaning your build and rebuilding the application from scratch (make distclean && qmake && make).
Re: very strange behaviour
I have made a new project with kdevelop on a fresh suse 10.0 installation. I imported only the sourcefiles, headers and ui files. I added the config macros and the libs and includes in the pro file, I ran qmake and it issued warnings about possible symbol conflicts in a lot of sourcefiles. I tried to build the project: no luck. I tried to build the subproject (what is the difference between a project and subproject??) and it compiled all the sourcefiles but failed to link the application properly
On the computer where the app is still compiling I ran make distclean in the src directory
It replied no rule to make or something like that probably because I removed all the .o files as well as the moc* files as well as the Makefile. So I ran qmake and in kdev I chose for build project and it compiled and linked fine. When I chose start debug, the application started but jumped over the breakpoint I had put in a constructor that is executed.
????
Rgx :crying:
Re: very strange behaviour
perhaps you could try compiling with the -g and -O0, so no optimisations.
This would help when debugging, the lines dont jump around seemingly random.
And then put a watch for the variable so the debugger stops at it, or when it changes.
Re: very strange behaviour
no effect after compiling with O0
Rgx
Re: very strange behaviour
Quote:
Originally Posted by regix
I have made a new project with kdevelop on a fresh suse 10.0 installation. I imported only the sourcefiles, headers and ui files. I added the config macros and the libs and includes in the pro file, I ran qmake and it issued warnings about possible symbol conflicts in a lot of sourcefiles. I tried to build the project: no luck. I tried to build the subproject (what is the difference between a project and subproject??) and it compiled all the sourcefiles but failed to link the application properly
Did you clean all the temporary files (especially ones that moc created) before moving them to the new project?
Re: very strange behaviour
I went into the src directory and did
rm *.o
rm moc*
rm Makefile
Are there any more files I should delete?
Rgx
Re: very strange behaviour
Try running 'make clean' or even 'make distclean'.