gdbtypes.resolve_dynamic_range: Add function description.
[deliverable/binutils-gdb.git] / gdb / score-tdep.c
index 784b912e13b072be0008be701ab6a815c3fa80da..c224189d16b76a5f95ef346a64b17939d1ba8b5b 100644 (file)
@@ -1,7 +1,7 @@
 /* Target-dependent code for the S+core architecture, for GDB,
    the GNU Debugger.
 
-   Copyright (C) 2006-2013 Free Software Foundation, Inc.
+   Copyright (C) 2006-2014 Free Software Foundation, Inc.
 
    Contributed by Qinwei (qinwei@sunnorth.com.cn)
    Contributed by Ching-Peng Lin (cplin@sunplus.com)
@@ -1447,6 +1447,12 @@ score7_linux_supply_gregset(const struct regset *regset,
   }
 }
 
+static const struct regset score7_linux_gregset =
+  {
+    NULL,
+    score7_linux_supply_gregset, NULL
+  };
+
 /* Return the appropriate register set from the core section identified
    by SECT_NAME and SECT_SIZE.  */
 
@@ -1454,20 +1460,11 @@ static const struct regset *
 score7_linux_regset_from_core_section(struct gdbarch *gdbarch,
                     const char *sect_name, size_t sect_size)
 {
-  struct gdbarch_tdep *tdep;
-
   gdb_assert (gdbarch != NULL);
   gdb_assert (sect_name != NULL);
 
-  tdep = gdbarch_tdep (gdbarch);
-
   if (strcmp(sect_name, ".reg") == 0 && sect_size == sizeof(elf_gregset_t))
-    {
-      if (tdep->gregset == NULL)
-       tdep->gregset = regset_alloc (gdbarch,
-                                     score7_linux_supply_gregset, NULL);
-      return tdep->gregset;
-    }
+    return &score7_linux_gregset;
 
   return NULL;
 }
@@ -1476,7 +1473,6 @@ static struct gdbarch *
 score_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 {
   struct gdbarch *gdbarch;
-  struct gdbarch_tdep *tdep;
   target_mach = info.bfd_arch_info->mach;
 
   arches = gdbarch_list_lookup_by_info (arches, &info);
@@ -1484,8 +1480,7 @@ score_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
     {
       return (arches->gdbarch);
     }
-  tdep = xcalloc(1, sizeof(struct gdbarch_tdep));
-  gdbarch = gdbarch_alloc (&info, tdep);
+  gdbarch = gdbarch_alloc (&info, NULL);
 
   set_gdbarch_short_bit (gdbarch, 16);
   set_gdbarch_int_bit (gdbarch, 32);
This page took 0.032875 seconds and 4 git commands to generate.