PDA

View Full Version : Maybe debug are "mission impossible" ?



tonnot
6th June 2011, 18:52
I dont know if I'm doing something bad, but If I try to debug my app I spend a lot of time.
Besides, I'm unable to detect the place when my program crash....
And is it possible that a simple var asignation consumes almost 1 second ??? (so If I want to review some var values and to know if some are the responsible of crashing I spend a lot of time.... )

I need your help. Or maybe debugging with QTcreator+Mingw (Win xp) are "mission impossible" ?

Any tutorial or link ?
Thanks

Santosh Reddy
6th June 2011, 19:15
Are your breakpoints working?

Tip: Let the program crash, and then have look at the call stack, and find out the last function which was written by you was called, mostly it will be the culprit

http://doc.qt.nokia.com/qtcreator-2.2/creator-debugging-example.html

tonnot
6th June 2011, 19:38
Yes, but the step betwen line and line spends 1 second ..... (as I said, are simple var asignations...)
My impression is that debug is very very slow...

Santosh Reddy
6th June 2011, 20:03
It can take time, it depends on your software environment factors, the better is to use breakpoints, and let it run freely till the break point, which is lot quicker, than stepping.

ChrisW67
6th June 2011, 23:37
Under MinGW the gdb debugger does take quite a while to load the debug version of your program and all the debug versions of referenced libraries. It is far slower to start than it is on Linux but still only measured in seconds. Once loaded the program will be a bit slower but nothing like a second per simple statement.

If your "simple var asignations" are taking a time measured in seconds then I'd be taking a long hard look at any constructors involved for tight endless (or nearly endless) loops, repetitive memory allocations, or long processes. If you can reproduce the problem with a 10-20 line program then by all means post the code here.

When the program crashes in the debugger read the stack backtrace from the top (most recent call) until you reach something in your code. That's where it crashed.