Community
Participate
Working Groups
The TCF agent expression evaluator is reporting the wrong values for bitfields. The following C code is used: struct g_struct { int a_int; short a_short; long a_long; char *a_string; unsigned a_bit:1; unsigned a_nibble:4; unsigned some_bits:9; unsigned many_bits:30; float a_float; struct g_struct_2 *a_struct; } g_struct = { G_STRUCT_A_INT, G_STRUCT_A_SHORT, G_STRUCT_A_LONG, G_STRUCT_A_STRING, G_STRUCT_A_BIT, G_STRUCT_A_NIBBLE, G_STRUCT_SOME_BITS, G_STRUCT_MANY_BITS, G_STRUCT_A_FLOAT, &g_struct_2 }; Where G_STRUCT_XXX is declared in a separate header file as: #define G_STRUCT_A_BIT 1 #define G_STRUCT_A_NIBBLE 3 #define G_STRUCT_SOME_BITS 129 #define G_STRUCT_MANY_BITS 987654321 The following calls are made to the TCF agent: expect_value(debugger, cpu, frame, "g_struct.a_bit", iv.G_STRUCT_A_BIT) expect_value(debugger, cpu, frame, "g_struct.a_nibble", iv.G_STRUCT_A_NIBBLE) expect_value(debugger, cpu, frame, "g_struct.some_bits", iv.G_STRUCT_SOME_BITS) expect_value(debugger, cpu, frame, "g_struct.many_bits", iv.G_STRUCT_MANY_BITS) We would expect the value for g_struct.a_bit to be "1" however the value reported is : 2583953408
I have committed a fix. Thanks!