+alpha_linux_sigcontext_addr (struct frame_info *this_frame)
+{
+ struct gdbarch *gdbarch = get_frame_arch (this_frame);
+ CORE_ADDR pc;
+ ULONGEST sp;
+ long off;
+
+ pc = get_frame_pc (this_frame);
+ sp = get_frame_register_unsigned (this_frame, ALPHA_SP_REGNUM);
+
+ off = alpha_linux_sigtramp_offset (gdbarch, pc);
+ gdb_assert (off >= 0);
+
+ /* __NR_rt_sigreturn has a couple of structures on the stack. This is:
+
+ struct rt_sigframe {
+ struct siginfo info;
+ struct ucontext uc;
+ };
+
+ offsetof (struct rt_sigframe, uc.uc_mcontext); */
+
+ if (alpha_read_insn (gdbarch, pc - off + 4) == 0x201f015f)
+ return sp + 176;
+
+ /* __NR_sigreturn has the sigcontext structure at the top of the stack. */
+ return sp;
+}
+
+/* Supply register REGNUM from the buffer specified by GREGS and LEN
+ in the general-purpose register set REGSET to register cache
+ REGCACHE. If REGNUM is -1, do this for all registers in REGSET. */
+
+static void
+alpha_linux_supply_gregset (const struct regset *regset,
+ struct regcache *regcache,
+ int regnum, const void *gregs, size_t len)
+{
+ const gdb_byte *regs = (const gdb_byte *) gregs;
+
+ gdb_assert (len >= 32 * 8);
+ alpha_supply_int_regs (regcache, regnum, regs, regs + 31 * 8,
+ len >= 33 * 8 ? regs + 32 * 8 : NULL);
+}
+
+/* Collect register REGNUM from the register cache REGCACHE and store
+ it in the buffer specified by GREGS and LEN as described by the
+ general-purpose register set REGSET. If REGNUM is -1, do this for
+ all registers in REGSET. */
+
+static void
+alpha_linux_collect_gregset (const struct regset *regset,
+ const struct regcache *regcache,
+ int regnum, void *gregs, size_t len)
+{
+ gdb_byte *regs = (gdb_byte *) gregs;
+
+ gdb_assert (len >= 32 * 8);
+ alpha_fill_int_regs (regcache, regnum, regs, regs + 31 * 8,
+ len >= 33 * 8 ? regs + 32 * 8 : NULL);
+}
+
+/* Supply register REGNUM from the buffer specified by FPREGS and LEN
+ in the floating-point register set REGSET to register cache
+ REGCACHE. If REGNUM is -1, do this for all registers in REGSET. */
+
+static void
+alpha_linux_supply_fpregset (const struct regset *regset,
+ struct regcache *regcache,
+ int regnum, const void *fpregs, size_t len)
+{
+ const gdb_byte *regs = (const gdb_byte *) fpregs;
+
+ gdb_assert (len >= 32 * 8);
+ alpha_supply_fp_regs (regcache, regnum, regs, regs + 31 * 8);
+}
+
+/* Collect register REGNUM from the register cache REGCACHE and store
+ it in the buffer specified by FPREGS and LEN as described by the
+ general-purpose register set REGSET. If REGNUM is -1, do this for
+ all registers in REGSET. */
+
+static void
+alpha_linux_collect_fpregset (const struct regset *regset,
+ const struct regcache *regcache,
+ int regnum, void *fpregs, size_t len)
+{
+ gdb_byte *regs = (gdb_byte *) fpregs;
+
+ gdb_assert (len >= 32 * 8);
+ alpha_fill_fp_regs (regcache, regnum, regs, regs + 31 * 8);
+}
+
+static const struct regset alpha_linux_gregset =
+{
+ NULL,
+ alpha_linux_supply_gregset, alpha_linux_collect_gregset
+};
+
+static const struct regset alpha_linux_fpregset =
+{
+ NULL,
+ alpha_linux_supply_fpregset, alpha_linux_collect_fpregset
+};
+
+/* Iterate over core file register note sections. */
+
+static void
+alpha_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
+ iterate_over_regset_sections_cb *cb,
+ void *cb_data,
+ const struct regcache *regcache)