/* Target-dependent code for GNU/Linux running on the Fujitsu FR-V,
for GDB.
- Copyright (C) 2004-2017 Free Software Foundation, Inc.
+ Copyright (C) 2004-2022 Free Software Foundation, Inc.
This file is part of GDB.
#include "frame-unwind.h"
#include "regset.h"
#include "linux-tdep.h"
+#include "gdbarch.h"
/* Define the size (in bytes) of an FR-V instruction. */
static const int frv_instr_size = 4;
static LONGEST
frv_linux_sigcontext_reg_addr (struct frame_info *this_frame, int regno,
- CORE_ADDR *sc_addr_cache_ptr)
+ CORE_ADDR *sc_addr_cache_ptr)
{
struct gdbarch *gdbarch = get_frame_arch (this_frame);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
else if (tramp_type == RT_SIGTRAMP)
{
/* For a realtime sigtramp frame, SP + 12 contains a pointer
- to a ucontext struct. The ucontext struct contains a
- sigcontext struct starting 24 bytes in. (The offset of
- uc_mcontext within struct ucontext is derived as follows:
- stack_t is a 12-byte struct and struct sigcontext is
- 8-byte aligned. This gives an offset of 8 + 12 + 4 (for
- padding) = 24.) */
+ to a ucontext struct. The ucontext struct contains a
+ sigcontext struct starting 24 bytes in. (The offset of
+ uc_mcontext within struct ucontext is derived as follows:
+ stack_t is a 12-byte struct and struct sigcontext is
+ 8-byte aligned. This gives an offset of 8 + 12 + 4 (for
+ padding) = 24.) */
if (target_read_memory (sp + 12, buf, sizeof buf) != 0)
{
warning (_("Can't read realtime sigtramp frame."));
return 0;
}
sc_addr = extract_unsigned_integer (buf, sizeof buf, byte_order);
- sc_addr += 24;
+ sc_addr += 24;
}
else
internal_error (__FILE__, __LINE__, _("not a signal trampoline"));
static const struct frame_unwind frv_linux_sigtramp_frame_unwind =
{
+ "frv linux sigtramp",
SIGTRAMP_FRAME,
default_frame_unwind_stop_reason,
frv_linux_sigtramp_frame_this_id,
static void
frv_linux_supply_gregset (const struct regset *regset,
- struct regcache *regcache,
+ struct regcache *regcache,
int regnum, const void *gregs, size_t len)
{
int regi;
void *cb_data,
const struct regcache *regcache)
{
- cb (".reg", sizeof (frv_elf_gregset_t), &frv_linux_gregset,
- NULL, cb_data);
- cb (".reg2", sizeof (frv_elf_fpregset_t), &frv_linux_fpregset,
- NULL, cb_data);
+ cb (".reg", sizeof (frv_elf_gregset_t), sizeof (frv_elf_gregset_t),
+ &frv_linux_gregset, NULL, cb_data);
+ cb (".reg2", sizeof (frv_elf_fpregset_t), sizeof (frv_elf_fpregset_t),
+ &frv_linux_fpregset, NULL, cb_data);
}
\f
static void
frv_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
- linux_init_abi (info, gdbarch);
+ linux_init_abi (info, gdbarch, 0);
/* Set the sigtramp frame sniffer. */
frame_unwind_append_unwinder (gdbarch, &frv_linux_sigtramp_frame_unwind);
return GDB_OSABI_UNKNOWN;
}
+void _initialize_frv_linux_tdep ();
void
-_initialize_frv_linux_tdep (void)
+_initialize_frv_linux_tdep ()
{
gdbarch_register_osabi (bfd_arch_frv, 0, GDB_OSABI_LINUX,
frv_linux_init_abi);