/* Motorola m68k target-dependent support for GNU/Linux.
- Copyright (C) 1996-2017 Free Software Foundation, Inc.
+ Copyright (C) 1996-2021 Free Software Foundation, Inc.
This file is part of GDB.
#include "defs.h"
#include "gdbcore.h"
-#include "doublest.h"
-#include "floatformat.h"
#include "frame.h"
#include "target.h"
#include "gdbtypes.h"
#include "glibc-tdep.h"
#include "solib-svr4.h"
#include "auxv.h"
-#include "observer.h"
+#include "observable.h"
#include "elf/common.h"
#include "linux-tdep.h"
#include "regset.h"
unsigned long insn0, insn1, insn2;
CORE_ADDR pc = get_frame_pc (this_frame);
- if (!safe_frame_unwind_memory (this_frame, pc - 4, buf, sizeof (buf)))
+ if (!safe_frame_unwind_memory (this_frame, pc - 4, {buf, sizeof (buf)}))
return 0;
insn1 = extract_unsigned_integer (buf + 4, 4, byte_order);
insn2 = extract_unsigned_integer (buf + 8, 4, byte_order);
static int target_is_uclinux;
static void
-m68k_linux_inferior_created (struct target_ops *objfile, int from_tty)
+m68k_linux_inferior_created (inferior *inf)
{
/* Record that we will need to re-evaluate whether we are running on a
uClinux or normal GNU/Linux target (see m68k_linux_get_sigtramp_info). */
static const struct frame_unwind m68k_linux_sigtramp_frame_unwind =
{
+ "m68k linux sigtramp",
SIGTRAMP_FRAME,
default_frame_unwind_stop_reason,
m68k_linux_sigtramp_frame_this_id,
void *cb_data,
const struct regcache *regcache)
{
- cb (".reg", M68K_LINUX_GREGS_SIZE, &m68k_linux_gregset, NULL, cb_data);
- cb (".reg2", M68K_LINUX_FPREGS_SIZE, &m68k_linux_fpregset, NULL, cb_data);
+ cb (".reg", M68K_LINUX_GREGS_SIZE, M68K_LINUX_GREGS_SIZE, &m68k_linux_gregset,
+ NULL, cb_data);
+ cb (".reg2", M68K_LINUX_FPREGS_SIZE, M68K_LINUX_FPREGS_SIZE,
+ &m68k_linux_fpregset, NULL, cb_data);
}
static void
m68k_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ m68k_gdbarch_tdep *tdep = (m68k_gdbarch_tdep *) gdbarch_tdep (gdbarch);
- linux_init_abi (info, gdbarch);
+ linux_init_abi (info, gdbarch, 0);
tdep->jb_pc = M68K_LINUX_JB_PC;
tdep->jb_elt_size = M68K_LINUX_JB_ELEMENT_SIZE;
/* GNU/Linux uses SVR4-style shared libraries. */
set_solib_svr4_fetch_link_map_offsets (gdbarch,
- svr4_ilp32_fetch_link_map_offsets);
+ linux_ilp32_fetch_link_map_offsets);
/* GNU/Linux uses the dynamic linker included in the GNU C Library. */
set_gdbarch_skip_solib_resolver (gdbarch, glibc_skip_solib_resolver);
/* Enable TLS support. */
set_gdbarch_fetch_tls_load_module_address (gdbarch,
- svr4_fetch_objfile_link_map);
+ svr4_fetch_objfile_link_map);
}
-/* Provide a prototype to silence -Wmissing-prototypes. */
-extern initialize_file_ftype _initialize_m68k_linux_tdep;
-
+void _initialize_m68k_linux_tdep ();
void
-_initialize_m68k_linux_tdep (void)
+_initialize_m68k_linux_tdep ()
{
gdbarch_register_osabi (bfd_arch_m68k, 0, GDB_OSABI_LINUX,
m68k_linux_init_abi);
- observer_attach_inferior_created (m68k_linux_inferior_created);
+ gdb::observers::inferior_created.attach (m68k_linux_inferior_created,
+ "m68k-linux-tdep");
}