Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] [Variables View bug] Variables View can not display array elements in a loop

Hi guys:
The Variables View can not display elements of an array within a loop.

Environment:
                  Eclipse 3.6
                  CDT 7.0.2
                  OS: Linux
                  GDB: 6.0

                  C/C++ application debugging is launched.

        How to reproduce:
                 Please check the source code in attachment,  debug it and have a look at:

 
X * myXpointer = XArray[0];
 
for (int i = 0 ; i < SomeNumber, i++)
{
    myXpointer[i] = somevalue;  //  line 31 in variables view, there should be as many elements as myXpointer[] has, right?
}

       Bugzilla:
              No match found, the only one is pretty early: https://bugs.eclipse.org/bugs/show_bug.cgi?id=120665

       Possible reason:
GDB version is too old?

       Thanks a lot!
Regards
邢云




全国最低价,天天在家冲照片,24小时发货上门!
#include <stdlib.h>
#include <stdio.h>
 
int xarray[5] = {1, 2, 3, 4, 5};
 
int foo(char *strings)
{
    if (strings)
        printf("%s\n", strings);
    else
        printf("Bad string!n");
 
      return 0;
 
}
 
int main(void)
{
    int *xarrayp = &xarray[0];
 
    int i;
 
     foo("bye");
    for (i = 0; i < 5; i++)
    {
        printf("%d\n", xarray[i]);
    }
 
    for (i = 0; i < 5; i++)
    {
        xarrayp[i] = i;
    }
 
    for (i = 0; i < 5; i++)
    {
        printf("%d\n", xarrayp[i]);
    }
 
    return 0;
}

Back to the top