Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* patch: signal trampoline frame cache corruption (repost?)
@ 2006-10-31 19:41 PAUL GILLIAM
  2006-10-31 23:28 ` Mark Kettenis
  0 siblings, 1 reply; 9+ messages in thread
From: PAUL GILLIAM @ 2006-10-31 19:41 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 548 bytes --]

This might be a repost.  

Attached is a patch to fix some signal trampoline frame cache corruption
that occurs on machines that have no FPU registers.  The corruption was
reported when running gdb 6.4 on a PowerPC 440.  If a backtrace command
was run after hitting a signal trampoline frame, the frame cache would
become corrupted and GDB would SIGSEGV.

I have checked the cvs head sources, and the code has moved, but has not
been fixed.  So I updated the patch to apply to cvs head.

Ok to commit?  (This is almost an obvious fix, isn't it?)



[-- Attachment #2: fix-sigtramp-cache.patch --]
[-- Type: text/x-patch, Size: 1049 bytes --]

---
 gdb/ppc-linux-tdep.c |   18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

--- gdb-6.4.orig/gdb/ppc-linux-tdep.c
+++ gdb-6.4/gdb/ppc-linux-tdep.c
@@ -967,14 +967,16 @@ ppc_linux_sigtramp_cache (struct frame_i
   trad_frame_set_reg_addr (this_cache, tdep->ppc_cr_regnum,
 			   gpregs + 38 * tdep->wordsize);
 
-  /* Floating point registers.  */
-  for (i = 0; i < 32; i++)
-    {
-      int regnum = i + FP0_REGNUM;
-      trad_frame_set_reg_addr (this_cache, regnum, fpregs + i * tdep->wordsize);
-    }
-  trad_frame_set_reg_addr (this_cache, tdep->ppc_fpscr_regnum,
-			   fpregs + 32 * tdep->wordsize);
+  if (ppc_floating_point_unit_p(gdbarch)) {
+	  /* Floating point registers.  */
+	  for (i = 0; i < 32; i++)
+	  {
+		  int regnum = i + FP0_REGNUM;
+		  trad_frame_set_reg_addr (this_cache, regnum, fpregs + i * tdep->wordsize);
+	  }
+	  trad_frame_set_reg_addr (this_cache, tdep->ppc_fpscr_regnum,
+			  fpregs + 32 * tdep->wordsize);
+  }
   trad_frame_set_id (this_cache, frame_id_build (base, func));
 }
 

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2006-11-14  1:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-31 19:41 patch: signal trampoline frame cache corruption (repost?) PAUL GILLIAM
2006-10-31 23:28 ` Mark Kettenis
2006-11-03 17:58   ` PAUL GILLIAM
2006-11-10 21:22     ` Daniel Jacobowitz
2006-11-13 17:42       ` [commit] signal trampoline frame cache corruption PAUL GILLIAM
2006-11-13 17:46         ` Daniel Jacobowitz
2006-11-13 18:57           ` PAUL GILLIAM
2006-11-13 19:05             ` Daniel Jacobowitz
2006-11-14  1:50               ` PAUL GILLIAM

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox