aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2001-07-30 21:09:44 +0000
committerMark Kettenis <kettenis@gnu.org>2001-07-30 21:09:44 +0000
commit8d7f6b4a806dea3c93d6d5883dea13d730607141 (patch)
tree5a0d5145463e632398433cab6136c27a378fbcb8 /gdb
parent65a4f13c671c568e6fb6ced31ddf7b42baa31aae (diff)
downloadgdb-8d7f6b4a806dea3c93d6d5883dea13d730607141.zip
gdb-8d7f6b4a806dea3c93d6d5883dea13d730607141.tar.gz
gdb-8d7f6b4a806dea3c93d6d5883dea13d730607141.tar.bz2
* i386-tdep.c (i386_register_convert_to_virtual): Replace
assertion with a warning if we're asked to convert towards a non-floating-point type. Zero out the the buffer where the data is supposed to be stored in that case.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/i386-tdep.c8
2 files changed, 14 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 34e8e91..8f8ee3b 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2001-07-30 Mark Kettenis <kettenis@gnu.org>
+
+ * i386-tdep.c (i386_register_convert_to_virtual): Replace
+ assertion with a warning if we're asked to convert towards a
+ non-floating-point type. Zero out the the buffer where the data
+ is supposed to be stored in that case.
+
2001-07-29 Eli Zaretskii <eliz@is.elta.co.il>
* config/djgpp/djconfig.sh: Unset CDPATH.
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 3aa8cb5..d8cfe0f 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -1046,7 +1046,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);