This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[committed] Fix sparc_xfer_wcookie()


The sparc_xfer_wcookie() function didn't properly indicate that we
reached "EOF".  This worked fine for target_read_partial(), but when
Daniel fixed the code in sparc-tdep.c to use target_read() this broke
(32-bit) sparc.  Unfortunately I only tested (64-bit) sparc64 where
this didn't make a difference.  Anyway, the fix is easy.

While there, I updated a comment about which versions of OpenBSD
support StackGhost with fully randomized cookies.

Mark


Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>

	* sparc-nat.c (sparc_xfer_wcookie): Signal EOF.  Tweak comment.

Index: sparc-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/sparc-nat.c,v
retrieving revision 1.32
diff -u -p -r1.32 sparc-nat.c
--- sparc-nat.c 17 Dec 2005 22:34:02 -0000 1.32
+++ sparc-nat.c 18 Aug 2006 08:39:52 -0000
@@ -264,14 +264,16 @@ sparc_xfer_wcookie (struct target_ops *o
   gdb_assert (object == TARGET_OBJECT_WCOOKIE);
   gdb_assert (readbuf && writebuf == NULL);
 
-  if (offset >= sizeof (unsigned long))
+  if (offset == sizeof (unsigned long))
+    return 0;			/* Signal EOF.  */
+  if (offset > sizeof (unsigned long))
     return -1;
 
 #ifdef PT_WCOOKIE
   /* If PT_WCOOKIE is defined (by <sys/ptrace.h>), assume we're
      running on an OpenBSD release that uses StackGhost (3.1 or
-     later).  As of release 3.4, OpenBSD doesn't use a randomized
-     cookie yet, but a future release probably will.  */
+     later).  Since release 3.6, OpenBSD uses a fully randomized
+     cookie.  */
   {
     int pid;
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]