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] Introduce i387_collect_fxsave


To be used elsewhere.

Committed,

Mark


Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>

	* i387-tdep.h: Update copyright year.
	(i387_collect_fxsave): New prototype.
	* i387-tdep.c: Update copyright year.
	(i387_collect_fxsave): New function containing most of the code
	from i387_fill_fxsave.
	(i387_fill_fxsave): Call i387_collect_fxsave.

Index: i387-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i387-tdep.c,v
retrieving revision 1.38
diff -u -p -r1.38 i387-tdep.c
--- i387-tdep.c 27 Nov 2003 20:35:38 -0000 1.38
+++ i387-tdep.c 28 Feb 2004 20:40:03 -0000
@@ -1,7 +1,7 @@
 /* Intel 387 floating point stuff.
 
    Copyright 1988, 1989, 1991, 1992, 1993, 1994, 1998, 1999, 2000,
-   2001, 2002, 2003 Free Software Foundation, Inc.
+   2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -613,14 +613,13 @@ i387_supply_fxsave (struct regcache *reg
 }
 
 /* Fill register REGNUM (if it is a floating-point or SSE register) in
-   *FXSAVE with the value in GDB's register cache.  If REGNUM is -1, do
-   this for all registers.  This function doesn't touch any of the
-   reserved bits in *FXSAVE.  */
+   *FXSAVE with the value from REGCACHE.  If REGNUM is -1, do this for
+   all registers.  This function doesn't touch any of the reserved
+   bits in *FXSAVE.  */
 
 void
-i387_fill_fxsave (void *fxsave, int regnum)
+i387_collect_fxsave (const struct regcache *regcache, int regnum, void *fxsave)
 {
-  struct regcache *regcache = current_regcache;
   struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
   char *regs = fxsave;
   int i;
@@ -684,6 +683,17 @@ i387_fill_fxsave (void *fxsave, int regn
 
 #undef I387_ST0_REGNUM
 #undef I387_NUM_XMM_REGS
+}
+
+/* Fill register REGNUM (if it is a floating-point or SSE register) in
+   *FXSAVE with the value in GDB's register cache.  If REGNUM is -1, do
+   this for all registers.  This function doesn't touch any of the
+   reserved bits in *FXSAVE.  */
+
+void
+i387_fill_fxsave (void *fxsave, int regnum)
+{
+  i387_collect_fxsave (current_regcache, regnum, fxsave);
 }
 
 /* Recreate the FTW (tag word) valid bits from the 80-bit FP data in
Index: i387-tdep.h
===================================================================
RCS file: /cvs/src/src/gdb/i387-tdep.h,v
retrieving revision 1.10
diff -u -p -r1.10 i387-tdep.h
--- i387-tdep.h 27 Nov 2003 20:35:38 -0000 1.10
+++ i387-tdep.h 28 Feb 2004 20:40:03 -0000
@@ -1,6 +1,6 @@
 /* Target-dependent code for the i387.
 
-   Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+   Copyright 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -94,6 +94,14 @@ extern void i387_fill_fsave (void *fsave
 
 extern void i387_supply_fxsave (struct regcache *regcache, int regnum,
 				const void *fxsave);
+
+/* Fill register REGNUM (if it is a floating-point or SSE register) in
+   *FXSAVE with the value from REGCACHE.  If REGNUM is -1, do this for
+   all registers.  This function doesn't touch any of the reserved
+   bits in *FXSAVE.  */
+
+extern void i387_collect_fxsave (const struct regcache *regcache, int regnum,
+				 void *fxsave);
 
 /* Fill register REGNUM (if it is a floating-point or SSE register) in
    *FXSAVE with the value in GDB's register cache.  If REGNUM is -1, do


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