Results 1 to 2 of 2

Thread: Debugging step by step through else rich code does not work

  1. #1
    Join Date
    Nov 2009
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Question Debugging step by step through else rich code does not work

    Code itself works fine, but a debugging step by step does no flow as expected.

    Debugging “focus” jumps to some illogical code block if keyword else is used. If else words are cleaned out, no problems exist. The attached code does not do anything meaningful, but exposes the problem.
    QtCreator 1.3.1 is used.

    Is this a known bug in Qt Creator? I tried two different debuggers with Creator.

    int Jump1()
    {
    int direction = 1;
    int currentValue = 0;
    int someValue = 2;
    int raplays = 42;
    int bitMask = 0x0;

    if(direction == 1)
    {
    if(currentValue < someValue)
    {
    bitMask |= 0x1;
    raplays = 7;
    bitMask |= 0x2; // Jumps from here...
    }
    else if(currentValue > someValue)
    {
    bitMask |= 0x4;
    raplays = 8;
    bitMask |= 0x8; // To here while debuging!!!!!!!!
    }
    }
    else if (direction != 1)
    // If else if is replaced with "if", previous if block works fine:
    //if (direction != 1)
    {
    bitMask |= 0x10;
    if(0 == 0)
    {
    bitMask |= 0x20;
    raplays = 7;
    bitMask |= 0x40;
    }
    bitMask |= 0x80;
    }

    bitMask = bitMask;
    return bitMask;
    }

  2. #2
    Join Date
    May 2008
    Posts
    155
    Thanked 15 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Debugging step by step through else rich code does not work

    Are you operating on an optimized build? Which two debuggers did you try?

Similar Threads

  1. How to step inside(debug) webkit code?
    By nish in forum Qt Programming
    Replies: 5
    Last Post: 30th December 2009, 12:23
  2. Step by step Qwt on MinGW
    By Doug Broadwell in forum Qwt
    Replies: 2
    Last Post: 23rd January 2009, 00:19
  3. learn how to install QT with msvc2005 step by step
    By coder1985 in forum Installation and Deployment
    Replies: 6
    Last Post: 20th December 2007, 19:56
  4. Video Tutorials or step by step guides?
    By Dumbledore in forum Newbie
    Replies: 2
    Last Post: 10th October 2007, 08:33
  5. Step by Step MySQL Plugin... what's next step?
    By chaosgeorge in forum Qt Programming
    Replies: 20
    Last Post: 5th November 2006, 15:32

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.