Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: dk on September 06, 2006, 02:07:52 pm

Title: Error with displaying array in the "Watches" window
Post by: dk on September 06, 2006, 02:07:52 pm
Sometimes content of arrays in the "Whatches" windows are wrong: all elements are shifted (i.e. A[1] is displayes on the first place, A[2] on the 2nd, ..., A[0] is displayed last).

Steps to reproduce:

1. Create a simple console application with one c++ file:

Code
int main()
{
    int A[5];
    A[0]=1;
return 0;
}

2. Set breakpoint to the line A[0]=1 and start debugging application.

3. After reaching breakpoint open "Watches" window, A is displayed as {2009315348,4012952,4012888,8,2009312941}:
(http://server.179.ru/~dk/cb1.png)


4. After executing line A[0]=1, A is displayed as
{4012952,4012888,8,2009312941,1}, i.e. all elements of A are shifted to the left:
(http://server.179.ru/~dk/cb2.png)

I am using 20060904 nightly build on windows and older revision on Linux.
Title: Re: Error with displaying array in the "Watches" window
Post by: mandrav on September 06, 2006, 02:37:51 pm
https://developer.berlios.de/bugs/?func=detailbug&bug_id=6687&group_id=5358
Title: Re: Error with displaying array in the "Watches" window
Post by: dk on September 06, 2006, 03:22:26 pm
"Due to an Operating System Upgrade the Services are unavailable..."
Title: Re: Error with displaying array in the "Watches" window
Post by: mandrav on September 06, 2006, 03:45:33 pm
"Due to an Operating System Upgrade the Services are unavailable..."

Sorry, worked before.
Anyway, this bug exists for some time and is already reported (link I gave you).
Title: Re: Error with displaying array in the "Watches" window
Post by: dk on September 06, 2006, 04:44:17 pm
Yes, I've found that bugreport. Do you think this is a same bug? Are there any progress in the fixing this bug?

Today I've recomended C::B for my students as a best open-source IDE for C++ development, and immediately they have found this ugly bug...
Title: Re: Error with displaying array in the "Watches" window
Post by: mandrav on September 06, 2006, 05:28:42 pm
I haven't worked on it yet.
It's an optimization bug, in that it doesn't display consecutive same values. So if you have an int[5] and all elements are initialized with the same value, you will only see the first value. The rest are skipped because of the  tree updating optimization.
I know this is not desirable but I 'll have to change the way the watches tree is constructed for this to be fixed. And so, it's taking some time...
Title: Re: Error with displaying array in the "Watches" window
Post by: dk on September 06, 2006, 05:51:59 pm
It's an optimization bug, in that it doesn't display consecutive same values. So if you have an int[5] and all elements are initialized with the same value
No, all elements have different values in my array, and they are all displayed, but in the wrong order!
Title: Re: Error with displaying array in the "Watches" window
Post by: mandrav on September 06, 2006, 05:56:54 pm
I tried to explain the root of the problem and gave an example...
Title: Re: Error with displaying array in the "Watches" window
Post by: mandrav on September 28, 2006, 02:20:16 pm
This and all related bugs are now fixed.
Title: Re: Error with displaying array in the "Watches" window
Post by: dk on October 07, 2006, 06:44:35 am
Thank you, it's really works correct!

Another minor bug (may be, new) with "Watches".

Start debugging that simple program ang goto to the last line. We will get:

(http://server.179.ru/~dk/cb3.png)

Now press F7 to go to the next line. Look at the "Watches window":

(http://server.179.ru/~dk/cb4.png)

We see two artifact strings in the "Watсhes" with old values of A array.

Should I post bug to BerliOS?

I am using svn revision 3025 of C::B and Linux.
Title: Re: Error with displaying array in the "Watches" window
Post by: killerbot on October 07, 2006, 10:04:31 am
please post it, otherwise this report might get lost in here
Title: Re: Error with displaying array in the "Watches" window
Post by: dk on October 07, 2006, 11:46:05 am
Bug #9035: https://developer.berlios.de/bugs/?func=detailbug&bug_id=9035&group_id=5358 (https://developer.berlios.de/bugs/?func=detailbug&bug_id=9035&group_id=5358).