Author Topic: Error with displaying array in the "Watches" window  (Read 7432 times)

Offline dk

  • Multiple posting newcomer
  • *
  • Posts: 55
    • Code::Blocks for ALT Linux Sisyphus
Error with displaying array in the "Watches" window
« 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}:



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:


I am using 20060904 nightly build on windows and older revision on Linux.
Denis Kirienko
C::B maintainer for ALT Linux distribution (http://www.sisyphus.ru/srpm/codeblocks)

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Be patient!
This bug will be fixed soon...

Offline dk

  • Multiple posting newcomer
  • *
  • Posts: 55
    • Code::Blocks for ALT Linux Sisyphus
Re: Error with displaying array in the "Watches" window
« Reply #2 on: September 06, 2006, 03:22:26 pm »
"Due to an Operating System Upgrade the Services are unavailable..."
Denis Kirienko
C::B maintainer for ALT Linux distribution (http://www.sisyphus.ru/srpm/codeblocks)

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Error with displaying array in the "Watches" window
« Reply #3 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).
Be patient!
This bug will be fixed soon...

Offline dk

  • Multiple posting newcomer
  • *
  • Posts: 55
    • Code::Blocks for ALT Linux Sisyphus
Re: Error with displaying array in the "Watches" window
« Reply #4 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...
Denis Kirienko
C::B maintainer for ALT Linux distribution (http://www.sisyphus.ru/srpm/codeblocks)

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Error with displaying array in the "Watches" window
« Reply #5 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...
Be patient!
This bug will be fixed soon...

Offline dk

  • Multiple posting newcomer
  • *
  • Posts: 55
    • Code::Blocks for ALT Linux Sisyphus
Re: Error with displaying array in the "Watches" window
« Reply #6 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!
Denis Kirienko
C::B maintainer for ALT Linux distribution (http://www.sisyphus.ru/srpm/codeblocks)

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Error with displaying array in the "Watches" window
« Reply #7 on: September 06, 2006, 05:56:54 pm »
I tried to explain the root of the problem and gave an example...
Be patient!
This bug will be fixed soon...

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Error with displaying array in the "Watches" window
« Reply #8 on: September 28, 2006, 02:20:16 pm »
This and all related bugs are now fixed.
Be patient!
This bug will be fixed soon...

Offline dk

  • Multiple posting newcomer
  • *
  • Posts: 55
    • Code::Blocks for ALT Linux Sisyphus
Re: Error with displaying array in the "Watches" window
« Reply #9 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:



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



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.
« Last Edit: October 07, 2006, 11:21:35 am by dkirienko »
Denis Kirienko
C::B maintainer for ALT Linux distribution (http://www.sisyphus.ru/srpm/codeblocks)

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5501
Re: Error with displaying array in the "Watches" window
« Reply #10 on: October 07, 2006, 10:04:31 am »
please post it, otherwise this report might get lost in here

Offline dk

  • Multiple posting newcomer
  • *
  • Posts: 55
    • Code::Blocks for ALT Linux Sisyphus
Denis Kirienko
C::B maintainer for ALT Linux distribution (http://www.sisyphus.ru/srpm/codeblocks)