2004-02-07 Mark Kettenis <kettenis@gnu.org>
+ * sparc-tdep.h (sparc_fetch_wcookie): New prototype.
+ * sparcnbsd-tdep.c (sparc32nbsd_sigcontext_saved_regs): Handle
+ StackGhost.
+
* sparc-tdep.c (sparc32_frame_prev_register): Rename local
variable `i6' to `i7'.
(sparc_supply_rwindow, sparc_collect_rwindow): Likewise.
/* Fetch the instruction at PC. */
extern unsigned long sparc_fetch_instruction (CORE_ADDR pc);
+/* Fetch StackGhost Per-Process XOR cookie. */
+extern ULONGEST sparc_fetch_wcookie (void);
+
extern CORE_ADDR sparc_analyze_prologue (CORE_ADDR pc, CORE_ADDR current_pc,
struct sparc_frame_cache *cache);
regnum <= SPARC_I7_REGNUM; regnum++, addr += 4)
saved_regs[regnum].addr = addr;
+ /* Handle StackGhost. */
+ {
+ ULONGEST wcookie = sparc_fetch_wcookie ();
+
+ if (wcookie != 0)
+ {
+ ULONGEST i7;
+
+ addr = saved_regs[SPARC_I7_REGNUM].addr;
+ i7 = get_frame_memory_unsigned (next_frame, addr, 4);
+ trad_frame_set_value (saved_regs, SPARC_I7_REGNUM, i7 ^ wcookie);
+ }
+ }
+
/* The floating-point registers are only saved if the EF bit in %prs
has been set. */