[PATH] Fix stupid bug in i387-tdep.c:print_i387_value()

Mark Kettenis kettenis@wins.uva.nl
Sun May 21 14:34:00 GMT 2000


Argh, I made a stupid mistake in my last change to the logic behind
"info float".  Using this command will set some bytes on the stack to
zero, which may crash GDB (or perhaps do some other bad things to
it).  I checked it in on both branches, just in case Andrew will spin
another release from the 5.0 branch.

Mark


2000-05-21  Mark Kettenis  <kettenis@gnu.org>

	* i387-tdep.c (print_i387_value): Cast &value to (char *) in
	pointer arithmetic.  Fixes a bug which manifested itself on
	FreeBSD.


Index: i387-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i387-tdep.c,v
retrieving revision 1.3
diff -u -p -r1.3 i387-tdep.c
--- i387-tdep.c	2000/04/12 00:22:56	1.3
+++ i387-tdep.c	2000/05/21 21:15:14
@@ -176,7 +176,8 @@ print_i387_value (char *raw)
     {
       /* Copy straight over, but take care of the padding.  */
       memcpy (&value, raw, FPU_REG_RAW_SIZE);
-      memset (&value + FPU_REG_RAW_SIZE, 0, sizeof (value) - FPU_REG_RAW_SIZE);
+      memset ((char *) &value + FPU_REG_RAW_SIZE, 0,
+	      sizeof (value) - FPU_REG_RAW_SIZE);
     }
   else
 #endif


More information about the Gdb-patches mailing list