Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Maxim Kuvyrkov <maxim@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: Daniel Jacobowitz <dan@codesourcery.com>
Subject: [PATCH, M68K] Handle lack of FPU registers
Date: Tue, 17 Nov 2009 12:22:00 -0000	[thread overview]
Message-ID: <4B02953C.4050606@codesourcery.com> (raw)
In-Reply-To: <4B029388.5070001@codesourcery.com>

[-- Attachment #1: Type: text/plain, Size: 390 bytes --]

This patch by Daniel Jacobowitz fixes handling of FPU-less ColdFire CPUs.

Note: m68k_gdbarch_init() invokes set_gdbarch_fp0_regnum twice, the 
first call is conditioned on fpregs_present, the second invocation is 
erroneous and, thus, should be removed.

Dan, feel free to check in this patch yourself.

Regards,

-- 
Maxim Kuvyrkov
CodeSourcery
maxim@codesourcery.com
(650) 331-3385 x724

[-- Attachment #2: fsf-gdb-m68k-cf-fp-regs.ChangeLog --]
[-- Type: text/plain, Size: 182 bytes --]

2009-11-17  Daniel Jacobowitz  <dan@codesourcery.com>

	* m68k-tdep.c (m68k_register_name): Check fpregs_present.
	(m68k_gdbarch_init): Remove a duplicate of set_gdbarch_fp0_regnum.

[-- Attachment #3: fsf-gdb-m68k-cf-fp-regs.patch --]
[-- Type: text/plain, Size: 1194 bytes --]

 ChangeLog.cf-fp-regs |    5 +++++
 gdb/m68k-tdep.c      |    4 +++-
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c
index dcf8779..9cbbbb3 100644
--- a/gdb/m68k-tdep.c
+++ b/gdb/m68k-tdep.c
@@ -179,6 +179,9 @@ m68k_register_name (struct gdbarch *gdbarch, int regnum)
   if (regnum < 0 || regnum >= ARRAY_SIZE (m68k_register_names))
     internal_error (__FILE__, __LINE__,
 		    _("m68k_register_name: illegal register number %d"), regnum);
+  else if (regnum >= M68K_FP0_REGNUM && regnum <= M68K_FPI_REGNUM
+	   && gdbarch_tdep (gdbarch)->fpregs_present == 0)
+    return "";
   else
     return m68k_register_names[regnum];
 }
@@ -1190,7 +1193,6 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_sp_regnum (gdbarch, M68K_SP_REGNUM);
   set_gdbarch_pc_regnum (gdbarch, M68K_PC_REGNUM);
   set_gdbarch_ps_regnum (gdbarch, M68K_PS_REGNUM);
-  set_gdbarch_fp0_regnum (gdbarch, M68K_FP0_REGNUM);
   set_gdbarch_convert_register_p (gdbarch, m68k_convert_register_p);
   set_gdbarch_register_to_value (gdbarch,  m68k_register_to_value);
   set_gdbarch_value_to_register (gdbarch, m68k_value_to_register);

  reply	other threads:[~2009-11-17 12:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-17 12:15 [PATCHES, M68K] Various fixes and improvements for M68K and ColdFire Maxim Kuvyrkov
2009-11-17 12:22 ` Maxim Kuvyrkov [this message]
2009-11-17 12:28 ` [PATCH, M68K] Add regformat file for ColdFire registers Maxim Kuvyrkov
2009-11-17 12:34 ` [PATCH, M68K] Fix initialization Maxim Kuvyrkov
2009-11-17 12:36 ` [PATCH, M68K] Support xml testsuite Maxim Kuvyrkov
2009-11-17 15:40 ` [PATCHES, M68K] Various fixes and improvements for M68K and ColdFire Daniel Jacobowitz

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=4B02953C.4050606@codesourcery.com \
    --to=maxim@codesourcery.com \
    --cc=dan@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    /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