/* Target-dependent code for OpenBSD/i386.
- Copyright (C) 1988-2013 Free Software Foundation, Inc.
+ Copyright (C) 1988-2014 Free Software Foundation, Inc.
This file is part of GDB.
#include "gdb_assert.h"
#include <string.h>
+#include "obsd-tdep.h"
#include "i386-tdep.h"
#include "i387-tdep.h"
#include "solib-svr4.h"
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);
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,
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;
}
/* 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;