/* Target-dependent code for QNX Neutrino x86.
- Copyright (C) 2003-2013 Free Software Foundation, Inc.
+ Copyright (C) 2003-2021 Free Software Foundation, Inc.
Contributed by QNX Software Systems Ltd.
#include "regcache.h"
#include "target.h"
-#include "gdb_assert.h"
-#include "gdb_string.h"
-
#include "i386-tdep.h"
#include "i387-tdep.h"
#include "nto-tdep.h"
static void
i386nto_supply_gregset (struct regcache *regcache, char *gpregs)
{
- struct gdbarch *gdbarch = get_regcache_arch (regcache);
+ struct gdbarch *gdbarch = regcache->arch ();
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
- if(tdep->gregset == NULL)
- tdep->gregset = regset_alloc (gdbarch, i386_supply_gregset,
- i386_collect_gregset);
-
gdb_assert (tdep->gregset_reg_offset == i386nto_gregset_reg_offset);
- tdep->gregset->supply_regset (tdep->gregset, regcache, -1,
- gpregs, NUM_GPREGS * 4);
+ i386_gregset.supply_regset (&i386_gregset, regcache, -1,
+ gpregs, NUM_GPREGS * 4);
}
static void
if (first_four)
{
/* fpu_control_word, fpu_status_word, fpu_tag_word, fpu_operand
- registers. */
+ registers. */
regsize = 2; /* Two bytes each. */
off_adjust = 0;
regno_base = I387_FCTRL_REGNUM (tdep);
{
int offset = nto_reg_offset (regno);
if (offset != -1)
- regcache_raw_collect (regcache, regno, data + offset);
+ regcache->raw_collect (regno, data + offset);
}
}
else if (regset == NTO_REG_FLOAT)
/* Our loader handles solib relocations differently than svr4. */
nto_svr4_so_ops.relocate_section_addresses
- = nto_relocate_section_addresses;
+ = nto_relocate_section_addresses;
/* Supply a nice function to find our solibs. */
nto_svr4_so_ops.find_and_open_solib
- = nto_find_and_open_solib;
+ = nto_find_and_open_solib;
/* Our linker code is in libc. */
nto_svr4_so_ops.in_dynsym_resolve_code
- = nto_in_dynsym_resolve_code;
+ = nto_in_dynsym_resolve_code;
}
set_solib_ops (gdbarch, &nto_svr4_so_ops);
-}
-/* Provide a prototype to silence -Wmissing-prototypes. */
-extern initialize_file_ftype _initialize_i386nto_tdep;
+ set_gdbarch_wchar_bit (gdbarch, 32);
+ set_gdbarch_wchar_signed (gdbarch, 0);
+}
+void _initialize_i386nto_tdep ();
void
-_initialize_i386nto_tdep (void)
+_initialize_i386nto_tdep ()
{
init_i386nto_ops ();
gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_QNXNTO,