* amd64-tdep.h: (amd64_collect_fxsave): New prototype.
[deliverable/binutils-gdb.git] / gdb / amd64-tdep.c
index 0e446682fe824448930e87efd6a2e91ac28e373e..e0b2ca046f598610a3f78008ba88bbeb9e54c483 100644 (file)
@@ -1168,6 +1168,25 @@ amd64_supply_fxsave (struct regcache *regcache, int regnum,
     }
 }
 
+/* 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.  */
+
+void
+amd64_collect_fxsave (const struct regcache *regcache, int regnum,
+                     void *fxsave)
+{
+  char *regs = fxsave;
+
+  i387_collect_fxsave (regcache, regnum, fxsave);
+
+  if (regnum == -1 || regnum == I387_FISEG_REGNUM)
+    regcache_raw_collect (regcache, I387_FISEG_REGNUM, regs + 12);
+  if (regnum == -1 || regnum == I387_FOSEG_REGNUM)
+    regcache_raw_collect (regcache, I387_FOSEG_REGNUM, regs + 20);
+}
+
 /* 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
@@ -1176,10 +1195,5 @@ amd64_supply_fxsave (struct regcache *regcache, int regnum,
 void
 amd64_fill_fxsave (char *fxsave, int regnum)
 {
-  i387_fill_fxsave (fxsave, regnum);
-
-  if (regnum == -1 || regnum == I387_FISEG_REGNUM)
-    regcache_collect (I387_FISEG_REGNUM, fxsave + 12);
-  if (regnum == -1 || regnum == I387_FOSEG_REGNUM)
-    regcache_collect (I387_FOSEG_REGNUM, fxsave + 20);
+  amd64_collect_fxsave (current_regcache, regnum, fxsave);
 }
This page took 0.024395 seconds and 4 git commands to generate.