/* Target-dependent code for GNU/Linux SPARC.
- Copyright (C) 2003-2014 Free Software Foundation, Inc.
+ Copyright (C) 2003-2019 Free Software Foundation, Inc.
This file is part of GDB.
SIGTRAMP_FRAME,
4,
{
- { 0x821020d8, -1 }, /* mov __NR_sugreturn, %g1 */
- { 0x91d02010, -1 }, /* ta 0x10 */
- { TRAMP_SENTINEL_INSN, -1 }
+ { 0x821020d8, ULONGEST_MAX }, /* mov __NR_sugreturn, %g1 */
+ { 0x91d02010, ULONGEST_MAX }, /* ta 0x10 */
+ { TRAMP_SENTINEL_INSN, ULONGEST_MAX }
},
sparc32_linux_sigframe_init
};
SIGTRAMP_FRAME,
4,
{
- { 0x82102065, -1 }, /* mov __NR_rt_sigreturn, %g1 */
- { 0x91d02010, -1 }, /* ta 0x10 */
- { TRAMP_SENTINEL_INSN, -1 }
+ { 0x82102065, ULONGEST_MAX }, /* mov __NR_rt_sigreturn, %g1 */
+ { 0x91d02010, ULONGEST_MAX }, /* ta 0x10 */
+ { TRAMP_SENTINEL_INSN, ULONGEST_MAX }
},
sparc32_linux_sigframe_init
};
}
\f
-const struct sparc_gregset sparc32_linux_core_gregset =
+const struct sparc_gregmap sparc32_linux_core_gregmap =
{
32 * 4, /* %psr */
33 * 4, /* %pc */
struct regcache *regcache,
int regnum, const void *gregs, size_t len)
{
- sparc32_supply_gregset (&sparc32_linux_core_gregset,
+ sparc32_supply_gregset (&sparc32_linux_core_gregmap,
regcache, regnum, gregs);
}
const struct regcache *regcache,
int regnum, void *gregs, size_t len)
{
- sparc32_collect_gregset (&sparc32_linux_core_gregset,
+ sparc32_collect_gregset (&sparc32_linux_core_gregmap,
regcache, regnum, gregs);
}
struct regcache *regcache,
int regnum, const void *fpregs, size_t len)
{
- sparc32_supply_fpregset (&sparc32_bsd_fpregset, regcache, regnum, fpregs);
+ sparc32_supply_fpregset (&sparc32_bsd_fpregmap, regcache, regnum, fpregs);
}
static void
const struct regcache *regcache,
int regnum, void *fpregs, size_t len)
{
- sparc32_collect_fpregset (&sparc32_bsd_fpregset, regcache, regnum, fpregs);
+ sparc32_collect_fpregset (&sparc32_bsd_fpregmap, regcache, regnum, fpregs);
}
/* Set the program counter for process PTID to PC. */
static void
sparc_linux_write_pc (struct regcache *regcache, CORE_ADDR pc)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (get_regcache_arch (regcache));
+ struct gdbarch_tdep *tdep = gdbarch_tdep (regcache->arch ());
ULONGEST psr;
regcache_cooked_write_unsigned (regcache, tdep->pc_regnum, pc);
static LONGEST
sparc32_linux_get_syscall_number (struct gdbarch *gdbarch,
- ptid_t ptid)
+ thread_info *thread)
{
- struct regcache *regcache = get_thread_regcache (ptid);
+ struct regcache *regcache = get_thread_regcache (thread);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
/* The content of a register. */
gdb_byte buf[4];
/* Getting the system call number from the register.
When dealing with the sparc architecture, this information
is stored at the %g1 register. */
- regcache_cooked_read (regcache, SPARC_G1_REGNUM, buf);
+ regcache->cooked_read (SPARC_G1_REGNUM, buf);
ret = extract_signed_integer (buf, 4, byte_order);
\f
+static const struct regset sparc32_linux_gregset =
+ {
+ NULL,
+ sparc32_linux_supply_core_gregset,
+ sparc32_linux_collect_core_gregset
+ };
+
+static const struct regset sparc32_linux_fpregset =
+ {
+ NULL,
+ sparc32_linux_supply_core_fpregset,
+ sparc32_linux_collect_core_fpregset
+ };
+
static void
sparc32_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
linux_init_abi (info, gdbarch);
- tdep->gregset = regset_alloc (gdbarch, sparc32_linux_supply_core_gregset,
- sparc32_linux_collect_core_gregset);
+ tdep->gregset = &sparc32_linux_gregset;
tdep->sizeof_gregset = 152;
- tdep->fpregset = regset_alloc (gdbarch, sparc32_linux_supply_core_fpregset,
- sparc32_linux_collect_core_fpregset);
+ tdep->fpregset = &sparc32_linux_fpregset;
tdep->sizeof_fpregset = 396;
tramp_frame_prepend_unwinder (gdbarch, &sparc32_linux_sigframe);
set_gdbarch_write_pc (gdbarch, sparc_linux_write_pc);
/* Functions for 'catch syscall'. */
- set_xml_syscall_file_name (XML_SYSCALL_FILENAME_SPARC32);
+ set_xml_syscall_file_name (gdbarch, XML_SYSCALL_FILENAME_SPARC32);
set_gdbarch_get_syscall_number (gdbarch,
sparc32_linux_get_syscall_number);
sparc32_linux_gdb_signal_to_target);
}
-/* Provide a prototype to silence -Wmissing-prototypes. */
-extern void _initialize_sparc_linux_tdep (void);
-
void
_initialize_sparc_linux_tdep (void)
{