[PATCH] Introduce i387_collect_fsave

Mark Kettenis
2004-03-15T22:48:27Z

Similar to what I already did for i387_collect_fxsave. The old
i387_fill_fsave and i387_fill_fxsave will be eliminated somewhere in
the future.

Committed,

Mark

Index: ChangeLog
from Mark Kettenis <m.kettenis@osp.nl>

* i387-tdep.h (i387_collect_fsave): New prototype.
* i387-tdep.c (i387_collect_fsave): New function containing most
of the code from i387_fill_fsave.
(i387_fill_fsave): Call i387_fill_fsave.

Index: i387-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i387-tdep.c,v
retrieving revision 1.39
diff -u -p -r1.39 i387-tdep.c
--- i387-tdep.c 28 Feb 2004 20:43:51 -0000 1.39
+++ i387-tdep.c 15 Mar 2004 22:41:24 -0000
@@ -424,14 +424,13 @@ i387_supply_fsave (struct regcache *regc
}

/* Fill register REGNUM (if it is a floating-point register) in *FSAVE
- 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 *FSAVE. */
+ 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
+ *FSAVE. */

void
-i387_fill_fsave (void *fsave, int regnum)
+i387_collect_fsave (const struct regcache *regcache, int regnum, void *fsave)
{
- struct regcache *regcache = current_regcache;
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
char *regs = fsave;
int i;
@@ -467,6 +466,17 @@ i387_fill_fsave (void *fsave, int regnum
regcache_raw_collect (regcache, i, FSAVE_ADDR (regs, i));
}
#undef I387_ST0_REGNUM
+}
+
+/* Fill register REGNUM (if it is a floating-point register) in *FSAVE
+ 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 *FSAVE. */
+
+void
+i387_fill_fsave (void *fsave, int regnum)
+{
+ i387_collect_fsave (current_regcache, regnum, fsave);
}
\f

Index: i387-tdep.h
===================================================================
RCS file: /cvs/src/src/gdb/i387-tdep.h,v
retrieving revision 1.11
diff -u -p -r1.11 i387-tdep.h
--- i387-tdep.h 28 Feb 2004 20:43:51 -0000 1.11
+++ i387-tdep.h 15 Mar 2004 22:41:24 -0000
@@ -82,6 +82,14 @@ extern void i387_supply_fsave (struct re
const void *fsave);

/* Fill register REGNUM (if it is a floating-point register) in *FSAVE
+ 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
+ *FSAVE. */
+
+extern void i387_collect_fsave (const struct regcache *regcache, int regnum,
+ void *fsave);
+
+/* Fill register REGNUM (if it is a floating-point register) in *FSAVE
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 *FSAVE. */