Results 1 to 8 of 8

Thread: Program loops at one line

  1. #1
    Join Date
    Sep 2009
    Posts
    9
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Program loops at one line

    Hi i have a quite strange problem....this is the code
    Qt Code:
    1. void ClassC::protocolList(QList<Protocol*> **list)
    2. {
    3. (*list) = this->mProtocolList;
    4. }
    To copy to clipboard, switch view to plain text mode 

    When i debug this assignment it doesn't go further.....it remains at this line

    Can anyone tell me why?
    Last edited by wysota; 30th September 2009 at 08:22.

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

    Default Re: Program loops at one line

    Can you elaborate how you debug and how it "remains at this line"?
    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.


  3. #3
    Join Date
    Sep 2009
    Posts
    9
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Program loops at one line

    I set a breakpoint one line before and the program stops as expected then i press step over and the program does one step. Now the debugger is at my problem assignment line....and when i press step over again it does not move on......in detail: the arrow which indicates at whic line the debugger is standing disappears for a second and the reappears at the same line....instead of appearing at the next line


    i hope i explained my problem in a way you can understand

  4. #4
    Join Date
    Apr 2009
    Location
    Valencia (Spain)
    Posts
    245
    Thanks
    38
    Thanked 19 Times in 19 Posts
    Qt products
    Qt4
    Platforms
    Symbian S60

    Default Re: Program loops at one line

    can you tell us which compiler are you using?

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

    Default Re: Program loops at one line

    Change your code to the following:
    Qt Code:
    1. void ClassC::protocolList(QList<Protocol*> **list)
    2. {
    3. qDebug() << Q_FUNC_INFO << "Enter";
    4. (*list) = this->mProtocolList;
    5. qDebug() << Q_FUNC_INFO << "Leave";
    6. }
    To copy to clipboard, switch view to plain text mode 
    And run your program without a debugger. See if the statements get printed properly. Maybe there is some problem with the debugger itself (Qt Creator is known to work not very well with MSVC 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.


  6. #6
    Join Date
    Sep 2009
    Posts
    9
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Program loops at one line

    When program reaches the line it crashes and windows says: ****.exe doesnt work anymore

    and debug output is:
    Starte D:\HTL\DA\*****\02_Software\01_Program\****\debug\ ****.exe...
    void ClassC:rotocolList(QList<Protocol*>**) Enter

    D:\HTL\DA\*****02_Software\01_Program\****\debug\* ****.exe beendet, Rückgabewert -1073741819

    I am using MinGW
    GNU Make 3.81

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

    Default Re: Program loops at one line

    In that case no wonder the debugger doesn't want to continue execution...

    Your code is simply invalid - I'd say you are passing an invalid pointer into this function. Why are you passing a pointer to a pointer to a list?
    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.


  8. #8
    Join Date
    Sep 2009
    Posts
    9
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Program loops at one line

    OK...now i have it!

    You where right wysota....it was an invalid pointer because somewhere in my code i initialised a local variable of the type ClassC with the same name.....after changing it to the real variable it all worked fine....i hope you understand what i mean ^^

    Thanks for the tipp

Similar Threads

  1. Why is my application's CPU usage always > 50%
    By richardander in forum Qt Programming
    Replies: 10
    Last Post: 14th October 2010, 22:22
  2. QTcpSocket exception.
    By Fastman in forum Qt Programming
    Replies: 9
    Last Post: 29th January 2008, 13:51
  3. Qwizard crashed when created in a slot
    By joshlareau in forum Qt Programming
    Replies: 9
    Last Post: 15th January 2008, 09:16
  4. KDE/QWT doubt on debian sarge
    By hildebrand in forum KDE Forum
    Replies: 13
    Last Post: 25th April 2007, 06:13
  5. QTableView paints too much
    By Jimmy2775 in forum Qt Programming
    Replies: 2
    Last Post: 26th July 2006, 18:42

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.