Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [m68k] correct m68k_convert_register_p for coldfire
@ 2009-11-06 13:04 Vladimir Prus
  2009-11-06 13:18 ` Mark Kettenis
  2009-11-06 13:23 ` Pedro Alves
  0 siblings, 2 replies; 9+ messages in thread
From: Vladimir Prus @ 2009-11-06 13:04 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: Text/Plain, Size: 610 bytes --]


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

[-- Attachment #2: m68k_convert_register_p.diff --]
[-- Type: text/x-patch, Size: 947 bytes --]

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/

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-11-08 12:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-06 13:04 [m68k] correct m68k_convert_register_p for coldfire Vladimir Prus
2009-11-06 13:18 ` Mark Kettenis
2009-11-06 13:23 ` Pedro Alves
2009-11-06 17:25   ` Vladimir Prus
2009-11-06 18:36     ` Daniel Jacobowitz
2009-11-06 19:27       ` Vladimir Prus
2009-11-06 23:27     ` Mark Kettenis
2009-11-07 11:02       ` Vladimir Prus
2009-11-08 12:29         ` Mark Kettenis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox