Set TYPE_LENGTH on a variant part
authorTom Tromey <tom@tromey.com>
Thu, 30 Aug 2018 21:04:03 +0000 (15:04 -0600)
committerTom Tromey <tom@tromey.com>
Fri, 31 Aug 2018 19:01:45 +0000 (13:01 -0600)
commitc07c917f276d6e055a4e6ba5be5d6b9c4d355de7
treea9283fe021bd284ff465e094accd3d009f64fe6b
parent7b93bc4c624821352ce32734c89589102eaded87
Set TYPE_LENGTH on a variant part

gdb represents a DW_TAG_variant_part as a union.  While normally DWARF
would not set the size of a DW_TAG_variant_part, gdb's representation
requires the TYPE_LENGTH to be set.

This patch arranges to set the TYPE_LENGTH of a variant part if it has
not already been set.

This fixes some Rust regressions when testing against a version of
rustc that emits DW_TAG_variant_part.

2018-08-31  Tom Tromey  <tom@tromey.com>

* dwarf2read.c (dwarf2_add_field): Set the TYPE_LENGTH of the
variant part type.
gdb/ChangeLog
gdb/dwarf2read.c