summaryrefslogtreecommitdiff
path: root/gdb/sparcnbsd-tdep.c
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2004-02-07 20:45:40 +0000
committerMark Kettenis <kettenis@gnu.org>2004-02-07 20:45:40 +0000
commit1c80067325ac5c90f84154900ac057780b7869af (patch)
tree31493e2c0cf2c040cb2283009f75c4244f307e04 /gdb/sparcnbsd-tdep.c
parent7d34766b6a1e38232506b9c6ebfa647e70c22463 (diff)
downloadbinutils-gdb-1c80067325ac5c90f84154900ac057780b7869af.tar.gz
* sparc-tdep.h (sparc_fetch_wcookie): New prototype.
* sparcnbsd-tdep.c (sparc32nbsd_sigcontext_saved_regs): Handle StackGhost.
Diffstat (limited to 'gdb/sparcnbsd-tdep.c')
-rw-r--r--gdb/sparcnbsd-tdep.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gdb/sparcnbsd-tdep.c b/gdb/sparcnbsd-tdep.c
index 7a23ff3134c..b1be7eb5b12 100644
--- a/gdb/sparcnbsd-tdep.c
+++ b/gdb/sparcnbsd-tdep.c
@@ -141,6 +141,20 @@ sparc32nbsd_sigcontext_saved_regs (struct frame_info *next_frame)
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. */