aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.rust/simple.exp
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-03-29 11:49:59 -0600
committerTom Tromey <tom@tromey.com>2018-04-17 13:37:44 -0600
commita037790ec570ae9f9bf535cbce25f238f90e8b4a (patch)
tree2c5232fd4fc9b0e6ce9f39a7696f9b46a42ab6c9 /gdb/testsuite/gdb.rust/simple.exp
parentc7dcbf88c6557f35d9e75ae6223a3e61e1f70578 (diff)
downloadgdb-a037790ec570ae9f9bf535cbce25f238f90e8b4a.zip
gdb-a037790ec570ae9f9bf535cbce25f238f90e8b4a.tar.gz
gdb-a037790ec570ae9f9bf535cbce25f238f90e8b4a.tar.bz2
Fix crash in quirk_rust_enum
I noticed that quirk_rust_enum can crash when presented with a union whose fields are all scalar types. This patch adds a new test case and fixes the bug. Regression tested on Fedora 26 x86-64. 2018-04-17 Tom Tromey <tom@tromey.com> * dwarf2read.c (quirk_rust_enum): Handle unions correctly. 2018-04-17 Tom Tromey <tom@tromey.com> * gdb.rust/simple.rs (Union): New type. (main): New local "u". * gdb.rust/simple.exp (test_one_slice): Add new test case.
Diffstat (limited to 'gdb/testsuite/gdb.rust/simple.exp')
-rw-r--r--gdb/testsuite/gdb.rust/simple.exp1
1 files changed, 1 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.rust/simple.exp b/gdb/testsuite/gdb.rust/simple.exp
index 846abe1..d70de33 100644
--- a/gdb/testsuite/gdb.rust/simple.exp
+++ b/gdb/testsuite/gdb.rust/simple.exp
@@ -277,6 +277,7 @@ gdb_test "print parametrized.next.val" \
gdb_test "print parametrized" \
" = simple::ParametrizedStruct<i32> \\{next: simple::ParametrizedEnum<\[a-z:\]*Box<simple::ParametrizedStruct<i32>>>::Val\\{val: $hex\\}, value: 0\\}"
+gdb_test "print u" " = simple::Union {f1: -1, f2: 255}"
load_lib gdb-python.exp
if {[skip_python_tests]} {