Fix ptype of single-member Rust enums
authorTom Tromey <tom@tromey.com>
Sat, 4 Feb 2017 05:11:46 +0000 (22:11 -0700)
committerTom Tromey <tom@tromey.com>
Sat, 4 Feb 2017 05:14:36 +0000 (22:14 -0700)
commitf0fd41c1926984fd1a524ff551286cba694539a0
tree7c41be8737477ed41b8498af6e68ef06c18202d7
parente25dae2ce112305078ae7593da30ababfff53612
Fix ptype of single-member Rust enums

While looking into PR rust/21097, I found that ptype of a
single-element enum in Rust did not always format the result properly.
In particular, it would leave out the members of a tuple struct.
Further testing showed that it also did the wrong thing for ordinary
struct members as well.

This patch fixes these problems.  I'm marking it as being associated
with the PR, since that is where the discovery was made; but this
doesn't actually fix that PR (which I think ultimately is due to a
Rust compiler bug).

Built and regtested on x86-64 Fedora 25, using the system Rust
compiler.  I'm checking this in.

2017-02-03  Tom Tromey  <tom@tromey.com>

PR rust/21097:
* rust-lang.c (rust_print_type) <TYPE_CODE_UNION>: Handle enums
with a single member.

2017-02-03  Tom Tromey  <tom@tromey.com>

PR rust/21097:
* gdb.rust/simple.exp: Add new tests.
gdb/ChangeLog
gdb/rust-lang.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.rust/simple.exp
This page took 0.122013 seconds and 4 git commands to generate.