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] New: "Info Variables" returns bad results for typedef array


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

            Bug ID: 15770
           Summary: "Info Variables" returns bad results for typedef array
           Product: gdb
           Version: 7.2
            Status: NEW
          Severity: normal
          Priority: P2
         Component: c++
          Assignee: unassigned at sourceware dot org
          Reporter: b_smith at aerosimulation dot com

When using "info variables" on a structure with a custom float type, the array
length value indicates 0 when it should be 8.

Sample code to reproduce is below:

test.c
--------------------------------
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];
   int a;
   char c;
} shm_rec_t;

shm_rec_t shm;

int main()
{
   return 0;
}
-------------------------------

At the command line:
$ g++ -g test.c -o T
$ gdb T
(gdb) info variables
...
...
(gdb) ptype shm_rec_t


- When called, this will return "float32 f32ara[0];" for the first element in
the struct.

-- 
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]