From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31128 invoked by alias); 6 Nov 2009 13:04:16 -0000 Received: (qmail 31112 invoked by uid 22791); 6 Nov 2009 13:04:15 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 06 Nov 2009 13:04:11 +0000 Received: (qmail 23786 invoked from network); 6 Nov 2009 13:04:09 -0000 Received: from unknown (HELO wind.localnet) (vladimir@127.0.0.2) by mail.codesourcery.com with ESMTPA; 6 Nov 2009 13:04:09 -0000 From: Vladimir Prus To: gdb-patches@sources.redhat.com Subject: [m68k] correct m68k_convert_register_p for coldfire Date: Fri, 06 Nov 2009 13:04:00 -0000 User-Agent: KMail/1.12.90 (Linux/2.6.24-25-generic; KDE/4.3.73; i686; svn-1043485; 2009-11-01) MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_S7B9KTq1WxlCDtJ" Message-Id: <200911061604.18419.vladimir@codesourcery.com> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-11/txt/msg00108.txt.bz2 --Boundary-00=_S7B9KTq1WxlCDtJ Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-length: 610 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 --Boundary-00=_S7B9KTq1WxlCDtJ Content-Type: text/x-patch; charset="UTF-8"; name="m68k_convert_register_p.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="m68k_convert_register_p.diff" Content-length: 947 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 + + 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 gdb/sim/common/ --Boundary-00=_S7B9KTq1WxlCDtJ--