+2018-07-11 Sergio Durigan Junior <sergiodj@redhat.com>
+
+ PR c++/23373
+ * c-typeprint.c (c_type_print_base_struct_union): Don't print
+ offsets/sizes for static members of a class/struct.
+
2018-07-07 Jan Kratochvil <jan.kratochvil@redhat.com>
* contrib/gdb-add-index.sh ($dwarf5): New, use it.
int newshow = show - 1;
- if (flags->print_offsets
+ if (!is_static && flags->print_offsets
&& (TYPE_CODE (TYPE_FIELD_TYPE (type, i)) == TYPE_CODE_STRUCT
|| TYPE_CODE (TYPE_FIELD_TYPE (type, i)) == TYPE_CODE_UNION))
{
+2018-07-11 Sergio Durigan Junior <sergiodj@redhat.com>
+
+ PR c++/23373
+ * gdb.base/ptype-offsets.cc (struct static_member): New
+ struct.
+ (main) <stmember>: New variable.
+ * gdb.base/ptype-offsets.exp: Add test for printing a struct
+ with a static member in it.
+
2018-07-04 Tom de Vries <tdevries@suse.de>
* gdb.dwarf2/dw2-error.exp: Update expected error message.
void *f16;
};
+/* See PR c++/23373. */
+
+struct static_member
+{
+ static static_member Empty;
+ int abc;
+};
int
main (int argc, char *argv[])
struct tyu e;
struct asd f;
uint8_t i;
+ static_member stmember;
return 0;
}
pass $test
}
}
+
+# Test that printing a struct with a static member of itself doesn't
+# get us into an infinite loop.
+gdb_test "ptype/o static_member" \
+ [multi_line \
+{/\* offset | size \*/ type = struct static_member \{} \
+{ static static_member Empty;} \
+{\/* 0 | 4 \*/ int abc;} \
+{} \
+{ /\* total size \(bytes\): 4 \*/} \
+{ \}}]