Add command support for Guile.
[deliverable/binutils-gdb.git] / gdb / i386obsd-tdep.c
index cf19c5007b1939c68058ade48e51f54a5d658f06..8f76e436aac18a8db588dd6b7b8ff0dd7c2572eb 100644 (file)
@@ -142,7 +142,8 @@ i386obsd_aout_supply_regset (const struct regset *regset,
                             struct regcache *regcache, int regnum,
                             const void *regs, size_t len)
 {
-  const struct gdbarch_tdep *tdep = gdbarch_tdep (regset->arch);
+  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  const struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
   const gdb_byte *gregs = regs;
 
   gdb_assert (len >= tdep->sizeof_gregset + I387_SIZEOF_FSAVE);
@@ -151,6 +152,11 @@ i386obsd_aout_supply_regset (const struct regset *regset,
   i387_supply_fsave (regcache, regnum, gregs + tdep->sizeof_gregset);
 }
 
+static const struct regset i386obsd_aout_gregset =
+  {
+    NULL, i386obsd_aout_supply_regset, NULL
+  };
+
 static const struct regset *
 i386obsd_aout_regset_from_core_section (struct gdbarch *gdbarch,
                                        const char *sect_name,
@@ -163,12 +169,7 @@ i386obsd_aout_regset_from_core_section (struct gdbarch *gdbarch,
 
   if (strcmp (sect_name, ".reg") == 0
       && sect_size >= tdep->sizeof_gregset + I387_SIZEOF_FSAVE)
-    {
-      if (tdep->gregset == NULL)
-        tdep->gregset =
-         regset_alloc (gdbarch, i386obsd_aout_supply_regset, NULL);
-      return tdep->gregset;
-    }
+    return &i386obsd_aout_gregset;
 
   return NULL;
 }
This page took 0.023667 seconds and 4 git commands to generate.