This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Restrict i387_convert_register_p
- From: Yao Qi <qiyao at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 24 May 2017 21:18:37 -0000
- Subject: [binutils-gdb] Restrict i387_convert_register_p
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=8c8f9122ce6e6c00f72914479af57a7b87244554
commit 8c8f9122ce6e6c00f72914479af57a7b87244554
Author: Yao Qi <yao.qi@linaro.org>
Date: Wed May 24 22:15:23 2017 +0100
Restrict i387_convert_register_p
gdb:
2017-05-24 Yao Qi <yao.qi@linaro.org>
* i387-tdep.c (i387_convert_register_p): Return false if type
code isn't TYPE_CODE_FLT.
Diff:
---
gdb/ChangeLog | 5 +++++
gdb/i387-tdep.c | 5 +++--
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 1234e14..29cd306 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2017-05-24 Yao Qi <yao.qi@linaro.org>
+ * i387-tdep.c (i387_convert_register_p): Return false if type
+ code isn't TYPE_CODE_FLT.
+
+2017-05-24 Yao Qi <yao.qi@linaro.org>
+
* alpha-tdep.c (alpha_convert_register_p): Return true if type
length is 4.
(alpha_register_to_value): Remove type length check.
diff --git a/gdb/i387-tdep.c b/gdb/i387-tdep.c
index 9206109..925f4e5 100644
--- a/gdb/i387-tdep.c
+++ b/gdb/i387-tdep.c
@@ -341,8 +341,9 @@ i387_convert_register_p (struct gdbarch *gdbarch, int regnum,
if (i386_fp_regnum_p (gdbarch, regnum))
{
/* Floating point registers must be converted unless we are
- accessing them in their hardware type. */
- if (type == i387_ext_type (gdbarch))
+ accessing them in their hardware type or TYPE is not float. */
+ if (type == i387_ext_type (gdbarch)
+ || TYPE_CODE (type) != TYPE_CODE_FLT)
return 0;
else
return 1;