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]

[PATCH/SPARC] Some minor cleanups


Removal of some duplicate code.  Copyright updates.

Committed to the branch.


Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>
 
	* sparc-tdep.h: Update copyright year.
	(sparc_fetch_instruction): New prototype.
	* sparc-tdep.c: Update copyright year.
	(sparc_fetch_instruction): Make global.
	* sparc64-tdep.c: Update copyright year.
	(sparc_fetch_instruction): Remove function.
	(X_OP, X_RD, X_A, X_COND, X_OP2, X_IMM22, X_OP3, X_I, X_DISP22)
	(X_DISP19): Really remove macros.
	* sparc64-sol2-tdep.c: Update copyright year.
	* sparc64fbsd-tdep.c: Likewise.

Index: sparc-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/sparc-tdep.c,v
retrieving revision 1.127.2.11
diff -u -p -r1.127.2.11 sparc-tdep.c
--- sparc-tdep.c 31 Dec 2003 20:46:51 -0000 1.127.2.11
+++ sparc-tdep.c 1 Jan 2004 21:04:12 -0000
@@ -1,6 +1,6 @@
 /* Target-dependent code for SPARC.
 
-   Copyright 2003 Free Software Foundation, Inc.
+   Copyright 2003, 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -87,7 +87,7 @@
 /* Fetch the instruction at PC.  Instructions are always big-endian
    even if the processor operates in little-endian mode.  */
 
-static unsigned long
+unsigned long
 sparc_fetch_instruction (CORE_ADDR pc)
 {
   unsigned char buf[4];
Index: sparc-tdep.h
===================================================================
RCS file: /cvs/src/src/gdb/sparc-tdep.h,v
retrieving revision 1.3.10.8
diff -u -p -r1.3.10.8 sparc-tdep.h
--- sparc-tdep.h 31 Dec 2003 17:26:11 -0000 1.3.10.8
+++ sparc-tdep.h 1 Jan 2004 21:04:12 -0000
@@ -1,6 +1,6 @@
 /* Target-dependent code for SPARC.
 
-   Copyright 2003 Free Software Foundation, Inc.
+   Copyright 2003, 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -135,6 +135,9 @@ struct sparc_frame_cache
   /* Table of saved registers.  */
   struct trad_frame_saved_reg *saved_regs;
 };
+
+/* Fetch the instruction at PC.  */
+extern unsigned long sparc_fetch_instruction (CORE_ADDR pc);
 
 extern CORE_ADDR sparc_analyze_prologue (CORE_ADDR pc, CORE_ADDR current_pc,
 					 struct sparc_frame_cache *cache);
Index: sparc64-sol2-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/Attic/sparc64-sol2-tdep.c,v
retrieving revision 1.1.2.3
diff -u -p -r1.1.2.3 sparc64-sol2-tdep.c
--- sparc64-sol2-tdep.c 1 Jan 2004 20:51:54 -0000 1.1.2.3
+++ sparc64-sol2-tdep.c 1 Jan 2004 21:04:12 -0000
@@ -1,6 +1,6 @@
 /* Target-dependent code for Solaris UltraSPARC.
 
-   Copyright 2003 Free Software Foundation, Inc.
+   Copyright 2003, 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
Index: sparc64-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/sparc64-tdep.c,v
retrieving revision 1.3.4.6
diff -u -p -r1.3.4.6 sparc64-tdep.c
--- sparc64-tdep.c 1 Jan 2004 20:51:54 -0000 1.3.4.6
+++ sparc64-tdep.c 1 Jan 2004 21:04:12 -0000
@@ -1,6 +1,6 @@
 /* Target-dependent code for UltraSPARC.
 
-   Copyright 2003 Free Software Foundation, Inc.
+   Copyright 2003, 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -48,37 +48,6 @@
 /* Please use the sparc32_-prefix for 32-bit specific code, the
    sparc64_-prefix for 64-bit specific code and the sparc_-prefix for
    code can handle both.  */
-
-/* Macros to extract fields from SPARC instructions.  */
-#define X_OP(i) (((i) >> 30) & 0x3)
-#define X_RD(i) (((i) >> 25) & 0x1f)
-#define X_A(i) (((i) >> 29) & 1)
-#define X_COND(i) (((i) >> 25) & 0xf)
-#define X_OP2(i) (((i) >> 22) & 0x7)
-#define X_IMM22(i) ((i) & 0x3fffff)
-#define X_OP3(i) (((i) >> 19) & 0x3f)
-#define X_I(i) (((i) >> 13) & 1)
-/* Sign extension macros.  */
-#define X_DISP22(i) ((X_IMM22 (i) ^ 0x200000) - 0x200000)
-#define X_DISP19(i) ((((i) & 0x7ffff) ^ 0x40000) - 0x40000)
-
-/* Fetch the instruction at PC.  Instructions are always big-endian
-   even if the processor operates in little-endian mode.  */
-
-static unsigned long
-sparc_fetch_instruction (CORE_ADDR pc)
-{
-  unsigned char buf[4];
-  unsigned long insn;
-  int i;
-
-  read_memory (pc, buf, sizeof (buf));
-
-  insn = 0;
-  for (i = 0; i < sizeof (buf); i++)
-    insn = (insn << 8) | buf[i];
-  return insn;
-}
 
 /* The functions on this page are intended to be used to classify
    function arguments.  */
Index: sparc64fbsd-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/sparc64fbsd-tdep.c,v
retrieving revision 1.2.6.5
diff -u -p -r1.2.6.5 sparc64fbsd-tdep.c
--- sparc64fbsd-tdep.c 1 Jan 2004 20:51:54 -0000 1.2.6.5
+++ sparc64fbsd-tdep.c 1 Jan 2004 21:04:12 -0000
@@ -1,6 +1,6 @@
 /* Target-dependent code for FreeBSD/sparc64.
 
-   Copyright 2003 Free Software Foundation, Inc.
+   Copyright 2003, 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 


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