This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/15770] "Info Variables" returns bad results for typedef array


http://sourceware.org/bugzilla/show_bug.cgi?id=15770

b_smith at aerosimulation dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #5 from b_smith at aerosimulation dot com ---
Tom,

Thanks for the diligence. Looking at your "info variables" output I just want
to confirm that you have the following lines in your test file (particular
attention to the float32):

  typedef float float32;

  const float32 hsi_range[] = {2.5, 5.0, 10.0, 20.0, 40.0, 80.0, 160.0, 320.0};

  typedef struct {
    float32 f32ara[8];
    ...
  }


It is important that the typdef is declared and then used for the const array.
>From your output, it looked like your array used a basic float, instead of the
typdef float32. When we use a standard float, the bug doesn't occur. The bug
requires a typdef type. Our output for "info variables" and "ptype" is:

(gdb) info variables
All defined variables:

File test.c:
shm_rec_t shm;
static float32 hsi_range[8];

(gdb) ptype shm_rec_t
type = struct shm_rec_t {
    float32 f32ara[0];
    int a;
    char c;
}



...versus your:

File q.cc:
shm_rec_t shm;
static const float hsi_range[8];

(gdb) ptype shm_rec_t
type = struct shm_rec_t {
    float f32ara[8];
    int a;
    char c;
}

However, I could understand if the outputs are different due to versioning, and
the new version resolved the type in both the "info variables" and "ptype"
calls. 

Thanks, 

Brad

-- 
You are receiving this mail because:
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]