PDA

View Full Version : Debug problem



waynew
10th May 2010, 00:55
Does anyone have any idea why when running debug, it shows a line number where the crash happened that is not in the function it listed?
Seems like it is really confused.

squidge
10th May 2010, 07:49
Sounds like the debug information is out of date. Have you tried a full rebuild before debugging?

SixDegrees
10th May 2010, 08:16
This could also be the result of optimization. Some compilers severely reduce or expand code when optimization is cranked up, and it isn't unusual for the correlation between object code and source lines to be lost. Make sure you don't have any optimization turned on while debugging.

Crashing at seemingly random places can also be symptomatic of other issues. If you insert additional statements - as simple as output statements, for example - and the crash point moves around, check to make sure all your classes have virtual destructors declared if they're part of an inheritance chain (pretty much everything in Qt is). That's been the main culprit when we've seen such behavior.

Outright stack corruption is another possibility. A memory-checking tool like valgrind can help here. There are probably similar tools available for Windows.

waynew
10th May 2010, 11:44
Thanks those are helpful suggestions. I'll dig into it.