Add `set print repeats' tests for C/C++ arrays
[binutils-gdb.git] / gdb / m2-typeprint.c
index 8209686980f25119a9c44dcde5341b75cc61540b..f929ab4df3ce90dfdb2f9694b6139e6ec99789d7 100644 (file)
@@ -1,5 +1,5 @@
 /* Support for printing Modula 2 types for GDB, the GNU debugger.
-   Copyright (C) 1986-2021 Free Software Foundation, Inc.
+   Copyright (C) 1986-2022 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -17,7 +17,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
-#include "gdb_obstack.h"
+#include "gdbsupport/gdb_obstack.h"
 #include "bfd.h"               /* Binary File Description */
 #include "symtab.h"
 #include "gdbtypes.h"
@@ -611,11 +611,11 @@ m2_enum (struct type *type, struct ui_file *stream, int show, int level)
          wrap_here ("    ");
          fputs_styled (type->field (i).name (),
                        variable_name_style.style (), stream);
-         if (lastval != TYPE_FIELD_ENUMVAL (type, i))
+         if (lastval != type->field (i).loc_enumval ())
            {
              fprintf_filtered (stream, " = %s",
-                               plongest (TYPE_FIELD_ENUMVAL (type, i)));
-             lastval = TYPE_FIELD_ENUMVAL (type, i);
+                               plongest (type->field (i).loc_enumval ()));
+             lastval = type->field (i).loc_enumval ();
            }
          lastval++;
        }