Results 1 to 12 of 12

Thread: I want runtime error output in qt creator IDE

  1. #1
    Join Date
    Jun 2009
    Posts
    9
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default I want runtime error output in qt creator IDE

    Hey, developement is very slow for me at the moment because everytime I get a runtime error, there messages are not useful.

    For example if I accident try to access a null pointer memory, instead of telling me null pointer exception and showing me the point in my code where this happened during runtime, I get a useless message saying assert error and a line within qt code of where this happened. Not useful at all, I have to step through each line in the code to find out where the exception is in my source code and then I have to try and work out the cause.

    How do I get qt to just output runtime error/exceptions and tell me the line in my code where this happens and not a generic line of code inside qt where it happenes.

    Thank you

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: I want runtime error output in qt creator IDE

    Build your application in debug mode and run it with gdb. Then you get exactly the line where your app crashes.

  3. #3
    Join Date
    Jun 2009
    Posts
    9
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: I want runtime error output in qt creator IDE

    Hi, thank you for your reply.

    In QtCreator, the Build -> Set build configuration -> debug button appears true. How do i use gdb to do it?

    Sorry it is my first project in QtCreator.

    Silver

  4. #4
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: I want runtime error output in qt creator IDE

    If your profile is right and you are working under Linux just hit the "debug" button which is direct under the normal run button in the creator. Or simply hit F5.

    (Normally gdb is installed. If not search your sources for that package, depending which distro you use.)

  5. #5
    Join Date
    Jun 2009
    Posts
    9
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: I want runtime error output in qt creator IDE

    This is what I do already. But I still get this error message.

    Qt Code:
    1. Unable to restore previously selected frame.
    2. Unable to restore previously selected frame.
    3. Unable to restore previously selected frame.
    4.  
    5. ASSERT failure in QVector<T>::at: "index out of range", file /home/silver/Programs/qtsdk-2009.02/qt/include/QtCore/qvector.h, line 329
    To copy to clipboard, switch view to plain text mode 

    Which doesn't give me a line in my code

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: I want runtime error output in qt creator IDE

    Why don't you just go to a higher frame to see where your code entered the invalid state? The current behaviour you observe is correct - Qt detects a problem during its own internal checks and notifies you about it. There is no access violation or anything just yet, so the program crashes in Qt code and not yours (because yours didn't have a chance to crash just yet). If you don't want those assers, build your application in release mode - then a "real" crash will occur.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Jun 2009
    Posts
    9
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: I want runtime error output in qt creator IDE

    I understand this, but I have no idea how to do this? I don't know how to check other frames as you mentioned or how to build in release mode.

    Im using QtCreator IDE under Ubuntu Linux Distro.

    Thank you

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: I want runtime error output in qt creator IDE

    Click on the frame in the debugger...
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  9. #9
    Join Date
    Jun 2009
    Posts
    9
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: I want runtime error output in qt creator IDE

    What is a frame ? Do you mean like a view or window inside the IDE, because I checked them all out.

    I looked everywhere in the debugger part and I cannot find any output that shows error messages relevant to my source code instead of theres. I mainly want to know where in my source code I called the qt parts that are erroring. ?

    thanks

  10. #10
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: I want runtime error output in qt creator IDE

    I mean a stack frame. If you don't know what it is, better learn it first before you get your hands wet with debugging.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  11. #11
    Join Date
    Jun 2009
    Posts
    9
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: I want runtime error output in qt creator IDE

    O it shows the stack, brilliant. I found it now.

    Hehe Its my first time acculi using an IDE properly, ive always just used make files. But thank you in the end :P

  12. #12
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: I want runtime error output in qt creator IDE

    Makefiles don't help much with debugging...

    By the way, Qt uses make too and IDE has nothing to do with it - it's an advanced text editor with integrated debugger and help system.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Qwt Data_Plot Example Runtime Error
    By AlphaWolfXV in forum Qwt
    Replies: 8
    Last Post: 27th January 2010, 10:11
  2. Runtime Error!
    By blm in forum Qt Programming
    Replies: 6
    Last Post: 25th September 2008, 14:56
  3. Replies: 5
    Last Post: 21st February 2007, 22:11

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.