Enable support for the AArch64 dot-prod instruction in the Cortex A55 and A75 cpus.
[deliverable/binutils-gdb.git] / gdb / reggroups.c
index 66b5c7867bece8f496ad52fcc2a6ce7cdc42b848..ae7d4ceeb722c29547fbcfe13d2e5a51a68b4030 100644 (file)
@@ -1,6 +1,6 @@
 /* Register groupings for GDB, the GNU debugger.
 
-   Copyright (C) 2002-2014 Free Software Foundation, Inc.
+   Copyright (C) 2002-2017 Free Software Foundation, Inc.
 
    Contributed by Red Hat.
 
@@ -102,13 +102,14 @@ add_group (struct reggroups *groups, struct reggroup *group,
 void
 reggroup_add (struct gdbarch *gdbarch, struct reggroup *group)
 {
-  struct reggroups *groups = gdbarch_data (gdbarch, reggroups_data);
+  struct reggroups *groups
+    = (struct reggroups *) gdbarch_data (gdbarch, reggroups_data);
 
   if (groups == NULL)
     {
       /* ULGH, called during architecture initialization.  Patch
          things up.  */
-      groups = reggroups_init (gdbarch);
+      groups = (struct reggroups *) reggroups_init (gdbarch);
       deprecated_set_gdbarch_data (gdbarch, reggroups_data, groups);
     }
   add_group (groups, group,
@@ -129,7 +130,7 @@ reggroup_next (struct gdbarch *gdbarch, struct reggroup *last)
 
   /* Don't allow this function to be called during architecture
      creation.  If there are no groups, use the default groups list.  */
-  groups = gdbarch_data (gdbarch, reggroups_data);
+  groups = (struct reggroups *) gdbarch_data (gdbarch, reggroups_data);
   gdb_assert (groups != NULL);
   if (groups->first == NULL)
     groups = &default_groups;
@@ -150,6 +151,35 @@ reggroup_next (struct gdbarch *gdbarch, struct reggroup *last)
   return NULL;
 }
 
+/* See reggroups.h.  */
+
+struct reggroup *
+reggroup_prev (struct gdbarch *gdbarch, struct reggroup *curr)
+{
+  struct reggroups *groups;
+  struct reggroup_el *el;
+  struct reggroup *prev;
+
+  /* Don't allow this function to be called during architecture
+     creation.  If there are no groups, use the default groups list.  */
+  groups = (struct reggroups *) gdbarch_data (gdbarch, reggroups_data);
+  gdb_assert (groups != NULL);
+  if (groups->first == NULL)
+    groups = &default_groups;
+
+  prev = NULL;
+  for (el = groups->first; el != NULL; el = el->next)
+    {
+      gdb_assert (el->group != NULL);
+      if (el->group == curr)
+       return prev;
+      prev = el->group;
+    }
+  if (curr == NULL)
+    return prev;
+  return NULL;
+}
+
 /* Is REGNUM a member of REGGROUP?  */
 int
 default_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
@@ -240,14 +270,11 @@ maintenance_print_reggroups (char *args, int from_tty)
     reggroups_dump (gdbarch, gdb_stdout);
   else
     {
-      struct cleanup *cleanups;
-      struct ui_file *file = gdb_fopen (args, "w");
+      stdio_file file;
 
-      if (file == NULL)
+      if (!file.open (args, "w"))
        perror_with_name (_("maintenance print reggroups"));
-      cleanups = make_cleanup_ui_file_delete (file);
-      reggroups_dump (gdbarch, file);
-      do_cleanups (cleanups);
+      reggroups_dump (gdbarch, &file);
     }
 }
 
This page took 0.025109 seconds and 4 git commands to generate.