This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[committed, testsuite] generalize enum regexp in gdb.cp/classes.exp
- From: Sandra Loosemore <sandra at codesourcery dot com>
- To: gdb-patches <gdb-patches at sourceware dot org>
- Date: Thu, 24 Sep 2015 19:29:12 -0600
- Subject: [committed, testsuite] generalize enum regexp in gdb.cp/classes.exp
- Authentication-results: sourceware.org; auth=none
This patch is very similar to the patch I pushed yesterday for
gdb.cp/var-tag.exp:
https://sourceware.org/ml/gdb-patches/2015-09/msg00555.html
I found another instance in gdb.cp/classes.exp where the regexp had a
hard-coded assumption that enum types are int-sized. This patch fixes
the failure on arm-none-eabi, where GCC defaults to -fshort-enums as
permitted by both the C++ standard and the AAPCS. I've checked it in as
obvious after verifying it works.
-Sandra
2015-09-24 Sandra Loosemore <sandra@codesourcery.com>
gdb/testsuite/
* gdb.cp/classes.exp (test_enums): Generalize regexp to allow
short or char as base type.
diff --git a/gdb/testsuite/gdb.cp/classes.exp b/gdb/testsuite/gdb.cp/classes.exp
index 1d714d3..00f16fc 100644
--- a/gdb/testsuite/gdb.cp/classes.exp
+++ b/gdb/testsuite/gdb.cp/classes.exp
@@ -419,7 +419,7 @@ proc test_enums {} {
# ptype on the enum member
gdb_test_multiple "ptype obj_with_enum.priv_enum" "ptype obj_with_enum.priv_enum" {
- -re "type = enum ClassWithEnum::PrivEnum (: unsigned int )?\{ ?(ClassWithEnum::)?red, (ClassWithEnum::)?green, (ClassWithEnum::)?blue, (ClassWithEnum::)?yellow = 42 ?\}$nl$gdb_prompt $" {
+ -re "type = enum ClassWithEnum::PrivEnum (: unsigned (int|short|char) )?\{ ?(ClassWithEnum::)?red, (ClassWithEnum::)?green, (ClassWithEnum::)?blue, (ClassWithEnum::)?yellow = 42 ?\}$nl$gdb_prompt $" {
pass "ptype obj_with_enum.priv_enum"
}
-re "type = enum PrivEnum \{ ?(ClassWithEnum::)?red, (ClassWithEnum::)?green, (ClassWithEnum::)?blue, (ClassWithEnum::)?yellow = 42 ?\}$nl$gdb_prompt $" {