This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH] Avoid floatformat_from_doublest() assertion failure
- From: Kevin Buettner <kevinb at redhat dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Thu, 8 Aug 2002 17:55:06 -0700
- Subject: [PATCH] Avoid floatformat_from_doublest() assertion failure
I've just committed the change below.
On Irix, I was running into an assertion failure in
floatformat_from_doublest() due to fmt being NULL. (gdb can't handle
16 byte long doubles.) The caller was store_floating() and, prior to
the call, had determined that fmt was NULL and had printed a suitable
warning. Moreover, the return value had been filled in with a
suitable value. (Well, as suitable as possible for something that
gdb says it can't do.)
* doublest.c (store_floating): Avoid floatformat_from_doublest()
assertion failure by returning early after a warning.
Index: doublest.c
===================================================================
RCS file: /cvs/src/src/gdb/doublest.c,v
retrieving revision 1.9
diff -u -p -r1.9 doublest.c
--- doublest.c 9 Feb 2002 17:25:57 -0000 1.9
+++ doublest.c 9 Aug 2002 00:37:23 -0000
@@ -681,6 +681,7 @@ store_floating (void *addr, int len, DOU
{
warning ("Can't store a floating-point number of %d bytes.", len);
memset (addr, 0, len);
+ return;
}
floatformat_from_doublest (fmt, &val, addr);