This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA] Fix double size for sh2e and sh3e cpus


The double datatype is defined as having 8 byte on all sh models.
But the sh2e and sh3e models are having 4 byte doubles due to their
fpu supporting 4 byte floting point only.  The attached patch (relative
to the previous undeprecate patch) fixes that.

Corinna

	* sh-tdep.c (sh_gdbarch_init): Set double to 4 byte on sh2e and sh3e.

--- sh-tdep.c.ORIG	2003-07-14 15:40:35.000000000 +0200
+++ sh-tdep.c	2003-07-14 17:28:56.000000000 +0200
@@ -4386,6 +4386,9 @@ sh_gdbarch_init (struct gdbarch_info inf
       set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, sh_nofp_frame_init_saved_regs);
       break;      
     case bfd_mach_sh2e:
+      /* doubles on sh2e and sh3e are actually 4 byte. */
+      set_gdbarch_double_bit (gdbarch, 4 * TARGET_CHAR_BIT);
+
       set_gdbarch_register_name (gdbarch, sh_sh2e_register_name);
       set_gdbarch_print_registers_info (gdbarch, sh_print_registers_info);
       sh_show_regs = sh2e_show_regs;
@@ -4446,6 +4449,9 @@ sh_gdbarch_init (struct gdbarch_info inf
       set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, sh_nofp_frame_init_saved_regs);
       break;
     case bfd_mach_sh3e:
+      /* doubles on sh2e and sh3e are actually 4 byte. */
+      set_gdbarch_double_bit (gdbarch, 4 * TARGET_CHAR_BIT);
+
       set_gdbarch_register_name (gdbarch, sh_sh3e_register_name);
       set_gdbarch_print_registers_info (gdbarch, sh_print_registers_info);
       sh_show_regs = sh3e_show_regs;

-- 
Corinna Vinschen
Cygwin Developer
Red Hat, Inc.
mailto:vinschen@redhat.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]