Add command support for Guile.
[deliverable/binutils-gdb.git] / gdb / i386obsd-tdep.c
index 9868b768e3ca40ec1d2ebe618858145be66a9104..8f76e436aac18a8db588dd6b7b8ff0dd7c2572eb 100644 (file)
@@ -33,6 +33,7 @@
 #include "gdb_assert.h"
 #include <string.h>
 
+#include "obsd-tdep.h"
 #include "i386-tdep.h"
 #include "i387-tdep.h"
 #include "solib-svr4.h"
@@ -141,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);
@@ -150,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,
@@ -162,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;
 }
@@ -447,6 +449,7 @@ i386obsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 
   /* Obviously OpenBSD is BSD-based.  */
   i386bsd_init_abi (info, gdbarch);
+  obsd_init_abi (info, gdbarch);
 
   /* OpenBSD has a different `struct reg'.  */
   tdep->gregset_reg_offset = i386obsd_r_reg_offset;
This page took 0.023699 seconds and 4 git commands to generate.