This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[m68k] correct m68k_convert_register_p for coldfire
- From: Vladimir Prus <vladimir at codesourcery dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Fri, 6 Nov 2009 16:04:18 +0300
- Subject: [m68k] correct m68k_convert_register_p for coldfire
The m68k_register_type function will return different types for
fp0 depending on whether we're on Coldfire, or classic m68k.
However, m68k_convert_register_p contains code such as:
static int
m68k_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type)
{
if (!gdbarch_tdep (gdbarch)->fpregs_present)
return 0;
return (regnum >= M68K_FP0_REGNUM && regnum <= M68K_FP0_REGNUM + 7
&& type != m68881_ext_type (gdbarch));
}
and therefore will return true on Coldfire. The attached patch addresses
this. Is it OK (with the name of changelog file adjusted)?
Thanks,
Volodya
Index: gdb/m68k-tdep.c
===================================================================
--- gdb/m68k-tdep.c (revision 219692)
+++ gdb/m68k-tdep.c (revision 219693)
@@ -177,7 +177,7 @@
if (!gdbarch_tdep (gdbarch)->fpregs_present)
return 0;
return (regnum >= M68K_FP0_REGNUM && regnum <= M68K_FP0_REGNUM + 7
- && type != builtin_type_m68881_ext);
+ && type != register_type (current_gdbarch, M68K_FP0_REGNUM));
}
/* Read a value of type TYPE from register REGNUM in frame FRAME, and
Index: ChangeLog.csl
===================================================================
--- ChangeLog.csl (revision 219692)
+++ ChangeLog.csl (revision 219693)
@@ -1,3 +1,10 @@
+2008-08-31 Vladimir Prus <vladimir@codesourcery.com>
+
+ gdb/
+ * m68k-tdep.c (m68k_convert_register_p): Compare with
+ the actual type of fp registers, not one of the possible
+ values.
+
2008-08-27 Julian Brown <julian@codesourcery.com>
gdb/sim/common/