Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "David S. Miller" <davem@redhat.com>
To: gdb-patches@sources.redhat.com
Subject: [RFA] Sparc/Linux fixes part 1
Date: Fri, 19 Apr 2002 14:54:00 -0000	[thread overview]
Message-ID: <20020419.144600.97361868.davem@redhat.com> (raw)


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  <davem@redhat.com>

	* 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:


             reply	other threads:[~2002-04-19 21:54 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-19 14:54 David S. Miller [this message]
2002-04-19 18:37 ` Michael Snyder
2002-04-19 18:43   ` David S. Miller
2002-04-19 18:55   ` David S. Miller
2002-04-19 19:13     ` Andrew Cagney
2002-04-19 19:16       ` David S. Miller
2002-04-19 19:18       ` David S. Miller
2002-04-19 19:46         ` Andrew Cagney
2002-04-19 19:53           ` David S. Miller
2002-04-20 19:01             ` David S. Miller
2002-04-20 19:13               ` Jason R Thorpe
2002-04-20 19:44                 ` Andrew Cagney
2002-04-20 20:06               ` Andrew Cagney
2002-04-20 20:18                 ` David S. Miller
2002-04-20 21:24                   ` Jason R Thorpe
2002-04-20 21:32                     ` David S. Miller
2002-04-20 23:41                       ` Andrew Cagney
2002-04-22  9:24               ` Elena Zannoni
2002-04-22  3:55             ` Richard Earnshaw
2002-04-22  4:09               ` David S. Miller
2002-04-19 19:55           ` David S. Miller
2002-04-20 10:00     ` Jason R Thorpe
2002-04-20 17:59       ` David S. Miller
2002-04-20 19:04         ` Jason R Thorpe
2002-04-20 19:19           ` David S. Miller
2002-04-20 19:24             ` Jason R Thorpe
2002-04-20 19:26               ` David S. Miller
2002-04-20 20:32               ` [RFA] Sparc OS abi gdbarch init (was Re: [RFA] Sparc/Linux fixes part 1) David S. Miller

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=20020419.144600.97361868.davem@redhat.com \
    --to=davem@redhat.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