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] Sparc/Linux patch 6



Ok, and this finally gets sparc64-*-linux native into a working
state.

This renumbers the sparc64 target registers so it is easy to
provide all the privileged registers, unavailable when tracking
userlevel processes, in a simple for loop.

This also hard-codes SPARC_TARGET_LONG_DOUBLE_SIZE until gdb is
capable of OS level gdbarch init.

Ideally, OS level gdbarch would change the NUM_REGS value so that
all these privileged registers aren't available/displayed when
they can't be obtained.  It really craps up the screen with useless
information when the user types "info registers" et al.

Sparc64 native begins with 124 failures.  Most of which have to do
with CALL_DUMMY bugs and what appears to be gcc-3.1 dwarf2 output bugs
on 64-bit targets with c++.

Acautlly, things are starting out in a better state then what I first
did this work.  My first working sparc64 native gdb, circa 2 weeks
ago, had some 400 some odd bugs first cut.  Actually, most of these
were sparc64 gcc bugs which I had to fix :-)

I'll start with the generic sparc bug fixes next.

2002-04-19  David S. Miller  <davem@redhat.com>

	* config/sparc/tm-sparc.h (sparc64 reg enum): Document values
	used internally for Y, PC, and NPC.  Move Y to be 80 instead
	of 84, bump {CCR,FSR,FPRS}_REGNUM up.
	* config/sparc/tm-sp64.h (REGISTER_NAMES): Update.
	(PC_REGNUM, NPC_REGNUM, CCR_REGNUM, FSR_REGNUM, FPRS_REGNUM,
	Y_REGNUM): Likewise.
	* sparc-tdep.c (sparc64_register_name): Update.
	(SPARC64_PC_REGNUM, SPARC64_NPC_REGNUM, SPARC64_Y_REGNUM):
	Likewise.

	* config/sparc/tm-sp64linux.h (SPARC_TARGET_LONG_DOUBLE_BYTES):
	Force to 16 until OS level gdbarch_init support exists.

--- ./config/sparc/tm-sp64.h.~1~	Fri Apr  5 16:02:51 2002
+++ ./config/sparc/tm-sp64.h	Fri Apr 19 23:02:03 2002
@@ -251,7 +251,7 @@ CORE_ADDR sparc64_push_arguments (int,
   "f32", "f34", "f36", "f38", "f40", "f42", "f44", "f46",	\
   "f48", "f50", "f52", "f54", "f56", "f58", "f60", "f62",	\
                                                                 \
-  "pc", "npc", "ccr", "fsr", "fprs", "y", "asi",		\
+  "y", "pc", "npc", "ccr", "fsr", "fprs", "asi",		\
   "ver", "tick", "pil", "pstate",				\
   "tstate", "tba", "tl", "tt", "tpc", "tnpc", "wstate",		\
   "cwp", "cansave", "canrestore", "cleanwin", "otherwin",	\
@@ -320,12 +320,12 @@ extern void sp64_extract_return_value (s
 
 #define C0_REGNUM 80			/* Start of control registers */
 
-#define PC_REGNUM (C0_REGNUM + 0)	/* Current PC */
-#define NPC_REGNUM (C0_REGNUM + 1)	/* Next PC */
-#define CCR_REGNUM (C0_REGNUM + 2)	/* Condition Code Register (%xcc,%icc) */
-#define FSR_REGNUM (C0_REGNUM + 3)	/* Floating Point State */
-#define FPRS_REGNUM (C0_REGNUM + 4)	/* Floating Point Registers State */
-#define	Y_REGNUM (C0_REGNUM + 5)	/* Temp register for multiplication, etc.  */
+#define	Y_REGNUM (C0_REGNUM + 0)	/* Temp register for multiplication, etc.  */
+#define PC_REGNUM (C0_REGNUM + 1)	/* Current PC */
+#define NPC_REGNUM (C0_REGNUM + 2)	/* Next PC */
+#define CCR_REGNUM (C0_REGNUM + 3)	/* Condition Code Register (%xcc,%icc) */
+#define FSR_REGNUM (C0_REGNUM + 4)	/* Floating Point State */
+#define FPRS_REGNUM (C0_REGNUM + 5)	/* Floating Point Registers State */
 #define ASI_REGNUM (C0_REGNUM + 6)	/* Alternate Space Identifier */
 #define VER_REGNUM (C0_REGNUM + 7)	/* Version register */
 #define TICK_REGNUM (C0_REGNUM + 8)	/* Tick register */
--- ./config/sparc/tm-sparc.h.~1~	Mon Jan 28 20:42:44 2002
+++ ./config/sparc/tm-sparc.h	Fri Apr 19 23:02:19 2002
@@ -67,10 +67,10 @@ enum {			/* Sparc32 control registers.  
 /* v9 misc. and priv. regs */
 
 /* Note: specifying values explicitly for documentation purposes.  */
-enum {	/* Sparc64 control registers, excluding Y, PC, and NPC.  */
-  CCR_REGNUM = 82,		/* Condition Code Register (%xcc,%icc) */
-  FSR_REGNUM = 83,		/* Floating Point State */
-  FPRS_REGNUM = 84,		/* Floating Point Registers State */
+enum {	/* Sparc64 control registers, excluding Y (80), PC (81), and NPC (82).  */
+  CCR_REGNUM = 83,		/* Condition Code Register (%xcc,%icc) */
+  FSR_REGNUM = 84,		/* Floating Point State */
+  FPRS_REGNUM = 85,		/* Floating Point Registers State */
   ASI_REGNUM = 86,		/* Alternate Space Identifier */
   VER_REGNUM = 87,		/* Version register */
   TICK_REGNUM = 88,		/* Tick register */
--- ./sparc-tdep.c.~1~	Fri Apr 19 22:38:57 2002
+++ ./sparc-tdep.c	Fri Apr 19 23:03:54 2002
@@ -2555,7 +2555,7 @@ sparc64_register_name (int regno)
     "f32", "f34", "f36", "f38", "f40", "f42", "f44", "f46",
     "f48", "f50", "f52", "f54", "f56", "f58", "f60", "f62",
 
-    "pc", "npc", "ccr", "fsr", "fprs", "y", "asi", "ver", 
+    "y", "pc", "npc", "ccr", "fsr", "fprs", "asi", "ver", 
     "tick", "pil", "pstate", "tstate", "tba", "tl", "tt", "tpc", 
     "tnpc", "wstate", "cwp", "cansave", "canrestore", "cleanwin", "otherwin",
     "asr16", "asr17", "asr18", "asr19", "asr20", "asr21", "asr22", "asr23", 
@@ -2901,9 +2901,9 @@ sparc_return_value_on_stack (struct type
 #define SPARC32_NPC_REGNUM 69
 #define SPARC32_PC_REGNUM  68
 #define SPARC32_Y_REGNUM   64
-#define SPARC64_PC_REGNUM  80
-#define SPARC64_NPC_REGNUM 81
-#define SPARC64_Y_REGNUM   85
+#define SPARC64_Y_REGNUM   80
+#define SPARC64_PC_REGNUM  81
+#define SPARC64_NPC_REGNUM 82
 
 static struct gdbarch *
 sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
--- ./config/sparc/tm-sp64linux.h.~1~	Fri Apr 19 22:38:31 2002
+++ ./config/sparc/tm-sp64linux.h	Fri Apr 19 23:26:34 2002
@@ -23,9 +23,10 @@ Foundation, Inc., 59 Temple Place - Suit
 
 #include "sparc/tm-sp64.h"
 
+/* ??? When we have OS level gdbarch set this based upon the target where
+   ??? GDB_TARGET_IS_SPARC64 is true or not  */
 #undef SPARC_TARGET_LONG_DOUBLE_BYTES
-#define SPARC_TARGET_LONG_DOUBLE_BYTES \
-	(GDB_TARGET_IS_SPARC64 ? 16 : 8)
+#define SPARC_TARGET_LONG_DOUBLE_BYTES 16
 
 #undef LONGJMP_TARGE_TSIZE
 #define LONGJMP_TARGET_SIZE (GDB_TARGET_IS_SPARC64 ? 8 : 4)


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