PDA

View Full Version : Breakpoints set at a slot will not stop?



MorrisLiang
18th May 2010, 18:23
When I debug my app,I set a breakpoint at a slot.When it runs,the slot will first be called just as normal functions.It stops as expected.I also connect a button's clicked() signal to the slot.So when I click on that button,the slot will be called.The slot does be called,but it never stop at the breakpoint.
Anybody knows why?Or do I miss something?

squidge
18th May 2010, 18:47
Are you running in debug mode or release mode?

MorrisLiang
19th May 2010, 02:27
I'm running in debug mode,because it stops at the beginning,but not at when the slot is triggered.

yodasoda
19th May 2010, 03:11
Same thing just happenned to me. Of course I verified the slot is actually called by setting the text of a label when it is called but I dont know what I could of done to cause this issue. tried another project and theres no problems there so its something in the project.


FOUND MY PROBLEM: When I added the following to my .pro file it created the problem:

OBJECTS_DIR = ./ObjectsDir
MOC_DIR = ./MocDir
UI_DIR = ./UiDir


Seems when the object,_moc or ui_ files are stored in separate folders GDB doesnt like It or needs further config.

As soon as I removed those directives I was fine....not before I got frustrated though :)_

The problem was the displaced moc_ files. So I removed MOC_DIR = ./MocDir


OBJECTS_DIR = ./ObjectsDir
UI_DIR = ./UiDir

I suggest you do a clean all, delete your Makefile, run QMake then build all. This could solve the issue. If not then try to start a new project and see if the problem is still there. If not then transfer you files little by little until the problem arrives or until you have transferred everything and the problem is no more.

MorrisLiang
19th May 2010, 04:11
OBJECTS_DIR = ./ObjectsDir
MOC_DIR = ./MocDir
UI_DIR = ./UiDir


I don't have these lines.
In my case,the ui_xxx.h files are in the same folder of the xxxx.ui files.
And the moc_xxxx.cpp files and the xxx.o files are in the "debug" folder.
Is it the same as your file structure?

squidge
19th May 2010, 09:30
Have you tried a complete rebuild and ensured that optimisation is set to none?

yodasoda
19th May 2010, 15:56
I don't have these lines.
In my case,the ui_xxx.h files are in the same folder of the xxxx.ui files.
And the moc_xxxx.cpp files and the xxx.o files are in the "debug" folder.
Is it the same as your file structure?

take those moc_xxx files out of debug and put them where your source files are

MorrisLiang
19th May 2010, 16:18
What is the optimisation?How do I enable/disable it.