Add `set print repeats' tests for C/C++ arrays
[binutils-gdb.git] / gdb / m2-lang.c
index fb813bd4349f857ae5636c28f386146c8cde99f7..1b53aff3f0d30ed2483b1d7cc7d05790606ac18c 100644 (file)
@@ -1,6 +1,6 @@
 /* Modula 2 language support routines for GDB, the GNU debugger.
 
-   Copyright (C) 1992-2021 Free Software Foundation, Inc.
+   Copyright (C) 1992-2022 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -37,7 +37,7 @@ eval_op_m2_high (struct type *expect_type, struct expression *exp,
                 enum noside noside,
                 struct value *arg1)
 {
-  if (noside == EVAL_SKIP || noside == EVAL_AVOID_SIDE_EFFECTS)
+  if (noside == EVAL_AVOID_SIDE_EFFECTS)
     return arg1;
   else
     {
@@ -50,7 +50,7 @@ eval_op_m2_high (struct type *expect_type, struct expression *exp,
 
          type = type->field (1).type ();
          /* i18n: Do not translate the "_m2_high" part!  */
-         arg1 = value_struct_elt (&temp, NULL, "_m2_high", NULL,
+         arg1 = value_struct_elt (&temp, {}, "_m2_high", NULL,
                                   _("unbounded structure "
                                     "missing _m2_high field"));
 
@@ -68,8 +68,6 @@ eval_op_m2_subscript (struct type *expect_type, struct expression *exp,
                      enum noside noside,
                      struct value *arg1, struct value *arg2)
 {
-  if (noside == EVAL_SKIP)
-    return eval_skip_value (exp);
   /* If the user attempts to subscript something that is not an
      array or pointer type (like a plain int variable for example),
      then report this as an error.  */
@@ -85,7 +83,7 @@ eval_op_m2_subscript (struct type *expect_type, struct expression *exp,
        error (_("internal error: unbounded "
                 "array structure is unknown"));
       /* i18n: Do not translate the "_m2_contents" part!  */
-      arg1 = value_struct_elt (&temp, NULL, "_m2_contents", NULL,
+      arg1 = value_struct_elt (&temp, {}, "_m2_contents", NULL,
                               _("unbounded structure "
                                 "missing _m2_contents field"));