2001-09-20 Michael Snyder <msnyder@redhat.com>
[binutils-gdb.git] / gdb / i386-tdep.c
index 3aa8cb543448cd370051cc77cd8251712d893652..c55757e76a69a318507fdb6e91852dfd612b9bcb 100644 (file)
@@ -32,6 +32,7 @@
 #include "command.h"
 #include "arch-utils.h"
 #include "regcache.h"
+#include "doublest.h"
 
 #include "gdb_assert.h"
 
@@ -1046,7 +1047,13 @@ i386_register_convert_to_virtual (int regnum, struct type *type,
   DOUBLEST d;
 
   /* We only support floating-point values.  */
-  gdb_assert (TYPE_CODE (type) == TYPE_CODE_FLT);
+  if (TYPE_CODE (type) != TYPE_CODE_FLT)
+    {
+      warning ("Cannot convert floating-point register value "
+              "to non-floating-point type.");
+      memset (to, 0, TYPE_LENGTH (type));
+      return;
+    }
 
   /* First add the necessary padding.  */
   memcpy (buf, from, FPU_REG_RAW_SIZE);