This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
[PATH] Fix stupid bug in i387-tdep.c:print_i387_value()
- To: gdb-patches at sourceware dot cygnus dot com
- Subject: [PATH] Fix stupid bug in i387-tdep.c:print_i387_value()
- From: Mark Kettenis <kettenis at wins dot uva dot nl>
- Date: Sun, 21 May 2000 23:34:06 +0200
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