From a9df3a80cc8b941d7d49b7715c221501e7cc9811 Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Mon, 30 Jul 2001 21:22:10 +0000 Subject: * 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. --- gdb/ChangeLog | 7 +++++++ gdb/i386-tdep.c | 8 +++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c7b53d4f9b2..4a35d174021 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2001-07-30 Mark Kettenis + + * 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 * config/djgpp/djconfig.sh: Unset CDPATH. diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index 3aa8cb54344..d8cfe0fd084 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); -- cgit v1.2.1