From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1844 invoked by alias); 19 Apr 2002 21:54:39 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 1737 invoked from network); 19 Apr 2002 21:54:36 -0000 Received: from unknown (HELO pizda.ninka.net) (216.101.162.242) by sources.redhat.com with SMTP; 19 Apr 2002 21:54:36 -0000 Received: from localhost (IDENT:davem@localhost.localdomain [127.0.0.1]) by pizda.ninka.net (8.9.3/8.9.3) with ESMTP id OAA07473 for ; Fri, 19 Apr 2002 14:46:00 -0700 Date: Fri, 19 Apr 2002 14:54:00 -0000 Message-Id: <20020419.144600.97361868.davem@redhat.com> To: gdb-patches@sources.redhat.com Subject: [RFA] Sparc/Linux fixes part 1 From: "David S. Miller" Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2002-04/txt/msg00639.txt.bz2 Ok, let's try to split up these changes even more in hopes someone might be able to start to look at least at the obvious bits. 32-bit Sparc under Linux does not have a 16-byte long double, this causes testsuite failures. Fix this by providing a SPARC_TARGET_LONG_DOUBLE_BYTES the OS specific target headers can override. Tested on sparc-linux-gnu, no regressions, a few new successes :-) 2002-04-19 David S. Miller * config/sparc/tm-sparc.h (SPARC_TARGET_LONG_DOUBLE_BYTES): New. (TARGET_LONG_DOUBLE_BIT): Define in non-multi-arch case. * config/sparc/tm-linux.h (SPARC_TARGET_LONG_DOUBLE_BYTES): Override. * config/sparc/tm-sp64linux.h (SPARC_TARGET_LONG_DOUBLE_BYTES): Override. * sparc-tdep.c (sparc_gdbarch_init): Use SPARC_TARGET_LONG_DOUBLE_BYTES in set_gdbarch_long_double_bit call. Do it after GDB_TARGET_IS_SPARC64 has stabilized. --- ./config/sparc/tm-sparc.h.~1~ Mon Jan 28 20:42:44 2002 +++ ./config/sparc/tm-sparc.h Fri Apr 19 13:55:48 2002 @@ -137,6 +137,8 @@ extern int sparc_intreg_size (void); #endif #endif +#define SPARC_TARGET_LONG_DOUBLE_BYTES 16 + #if !defined (GDB_MULTI_ARCH) || (GDB_MULTI_ARCH == 0) /* * The following defines must go away for MULTI_ARCH @@ -175,6 +177,11 @@ extern int sparc_intreg_size (void); real way to know how big a register is. */ #define REGISTER_SIZE 4 + +/* Say how large a 'long double' is. */ + +#define TARGET_LONG_DOUBLE_BIT \ + (SPARC_TARGET_LONG_DOUBLE_BYTES * TARGET_CHAR_BIT) /* Number of machine registers */ --- ./config/sparc/tm-linux.h.~1~ Sun Feb 24 14:56:07 2002 +++ ./config/sparc/tm-linux.h Fri Apr 19 13:58:11 2002 @@ -25,6 +25,9 @@ #include "sparc/tm-sparc.h" +#undef SPARC_TARGET_LONG_DOUBLE_BYTES +#define SPARC_TARGET_LONG_DOUBLE_BYTES 8 + #define SIGCONTEXT_PC_OFFSET 12 #include "tm-linux.h" --- ./config/sparc/tm-sp64linux.h.~1~ Sun Feb 24 14:56:07 2002 +++ ./config/sparc/tm-sp64linux.h Fri Apr 19 13:58:03 2002 @@ -25,6 +25,10 @@ Foundation, Inc., 59 Temple Place - Suit #include "sparc/tm-sp64.h" +#undef SPARC_TARGET_LONG_DOUBLE_BYTES +#define SPARC_TARGET_LONG_DOUBLE_BYTES \ + (GDB_TARGET_IS_SPARC64 ? 16 : 8) + #define SIGCONTEXT_PC_OFFSET 16 /* See asm-sparc64/sigcontext.h */ /* We always want full V9 + Ultra VIS stuff... */ --- ./sparc-tdep.c.~1~ Fri Apr 12 11:18:57 2002 +++ ./sparc-tdep.c Fri Apr 19 13:57:40 2002 @@ -2970,7 +2970,6 @@ sparc_gdbarch_init (struct gdbarch_info set_gdbarch_init_extra_frame_info (gdbarch, sparc_init_extra_frame_info); set_gdbarch_inner_than (gdbarch, core_addr_lessthan); set_gdbarch_int_bit (gdbarch, 4 * TARGET_CHAR_BIT); - set_gdbarch_long_double_bit (gdbarch, 16 * TARGET_CHAR_BIT); set_gdbarch_long_long_bit (gdbarch, 8 * TARGET_CHAR_BIT); set_gdbarch_max_register_raw_size (gdbarch, 8); set_gdbarch_max_register_virtual_size (gdbarch, 8); @@ -3114,6 +3113,11 @@ sparc_gdbarch_init (struct gdbarch_info tdep->call_dummy_call_offset = 148 + 4 * 5; break; } + + /* Set this after GDB_TARGET_IS_SPARC64 has stabilized. */ + set_gdbarch_long_double_bit (gdbarch, + SPARC_TARGET_LONG_DOUBLE_BYTES + * TARGET_CHAR_BIT); /* * Settings that vary per-architecture: