diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e8bed141c2..3f40c3133c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2016-04-01 Artemiy Volkov + + PR gdb/19820 + * eval.c (evaluate_subexp_standard): Allow TYPE_CODE_ENUM to be + the type of BINOP_REPEAT's second operand. + 2016-03-31 Yichao Yu PR gdb/19858 diff --git a/gdb/eval.c b/gdb/eval.c index 78ad946391..5d32a3cd4b 100644 --- a/gdb/eval.c +++ b/gdb/eval.c @@ -2427,7 +2427,8 @@ evaluate_subexp_standard (struct type *expect_type, if (noside == EVAL_SKIP) goto nosideret; type = check_typedef (value_type (arg2)); - if (TYPE_CODE (type) != TYPE_CODE_INT) + if (TYPE_CODE (type) != TYPE_CODE_INT + && TYPE_CODE (type) != TYPE_CODE_ENUM) error (_("Non-integral right operand for \"@\" operator.")); if (noside == EVAL_AVOID_SIDE_EFFECTS) { diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 083e6141e7..c4338ff49e 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-04-01 Artemiy Volkov + + PR gdb/19820 + * gdb.base/printcmds.exp: Add artificial arrays tests. + 2016-03-31 Pedro Alves PR gdb/19858 diff --git a/gdb/testsuite/gdb.base/printcmds.exp b/gdb/testsuite/gdb.base/printcmds.exp index 3c78a53e45..d599a70e10 100644 --- a/gdb/testsuite/gdb.base/printcmds.exp +++ b/gdb/testsuite/gdb.base/printcmds.exp @@ -643,6 +643,11 @@ proc test_artificial_arrays {} { gdb_test_escape_braces "p int1dim\[0\]${ctrlv}@2${ctrlv}@3" \ "({{0, 1}, {2, 3}, {4, 5}}|\[Cc\]annot.*)" \ {p int1dim[0]@2@3} + gdb_test_escape_braces "p int1dim\[0\]${ctrlv}@TWO" " = {0, 1}" \ + {p int1dim[0]@TWO} + gdb_test_escape_braces "p int1dim\[0\]${ctrlv}@TWO${ctrlv}@three" \ + "({{0, 1}, {2, 3}, {4, 5}}|\[Cc\]annot.*)" \ + {p int1dim[0]@TWO@three} gdb_test_escape_braces {p/x (short [])0x12345678} \ " = ({0x1234, 0x5678}|{0x5678, 0x1234})" }