Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Vladimir Prus <vladimir@codesourcery.com>
To: gdb-patches@sources.redhat.com
Subject: [m68k] correct m68k_convert_register_p for coldfire
Date: Fri, 06 Nov 2009 13:04:00 -0000	[thread overview]
Message-ID: <200911061604.18419.vladimir@codesourcery.com> (raw)

[-- 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/

             reply	other threads:[~2009-11-06 13:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-06 13:04 Vladimir Prus [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200911061604.18419.vladimir@codesourcery.com \
    --to=vladimir@codesourcery.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox