This is the mail archive of the gdb-testers@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]

[binutils-gdb] Fix Rust enum test failures


*** TEST RESULTS FOR COMMIT c7b15a66dc9ef2285f0983759d41baf5b9933505 ***

Author: Tom Tromey <tom@tromey.com>
Branch: master
Commit: c7b15a66dc9ef2285f0983759d41baf5b9933505

Fix Rust enum test failures

Pedro pointed out that some Rust tests were failing after the recent
enum change.  I was able to reproduce this even with the most current
Rust compiler -- no test was failing, but rather the gdb internal
error was causing an "untested" result, which I didn't notice.

The internal error is caused by a bad assertion in
alloc_discriminant_info.  This happened because, in an earlier version
of the patch, the discriminant could only appear at index 0.  However,
it can now appear anywhere.  This patch fixes the assertion in the
obvious way, and adds a second assertion to ensure that the
discriminant is also correct.

Fixing this revealed a real failure, which was caused by using the
wrong base name when computing the name of a univariant enum's sole
member.  This is also fixed here.

Tested by running the gdb.rust tests with rustc 1.23 and
double-checking the summary:

    # of expected passes		276

Note that if you try this yourself, it is still possible to get an
"untested" result from traits.exp if your Rust compiler is old enough.

2018-03-01  Tom Tromey  <tom@tromey.com>

	* dwarf2read.c (alloc_discriminant_info): Fix default_index
	assertion.  Add assertion for discriminant_index.
	(quirk_rust_enum): Use correct base type name in univariant case.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]