Results 1 to 4 of 4

Thread: Debug problem

  1. #1
    Join Date
    May 2009
    Location
    USA
    Posts
    300
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    82
    Thanked 11 Times in 11 Posts

    Default Debug problem

    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.

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    6
    Thanked 348 Times in 333 Posts

    Default Re: Debug problem

    Sounds like the debug information is out of date. Have you tried a full rebuild before debugging?

  3. #3
    Join Date
    Apr 2010
    Posts
    769
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11
    Thanks
    1
    Thanked 94 Times in 86 Posts

    Default Re: Debug problem

    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.

  4. The following user says thank you to SixDegrees for this useful post:

    waynew (10th May 2010)

  5. #4
    Join Date
    May 2009
    Location
    USA
    Posts
    300
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    82
    Thanked 11 Times in 11 Posts

    Default Re: Debug problem

    Thanks those are helpful suggestions. I'll dig into it.

Similar Threads

  1. qt in vc++ debug problem
    By sujan.dasmahapatra in forum Qt Programming
    Replies: 6
    Last Post: 5th December 2009, 17:51
  2. Problem using Qt debug frameworks on Mac
    By bibbinator in forum Qt Programming
    Replies: 2
    Last Post: 5th November 2009, 07:50
  3. Debug / Release Problem
    By messifanboy in forum Newbie
    Replies: 8
    Last Post: 7th October 2009, 16:23
  4. Problem with VS 9 & debug
    By bfarman in forum Installation and Deployment
    Replies: 1
    Last Post: 3rd January 2009, 16:13
  5. debug problem
    By nicky in forum Qt Programming
    Replies: 1
    Last Post: 8th January 2007, 08:54

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.