aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2004-02-28 20:48:57 +0000
committerMark Kettenis <kettenis@gnu.org>2004-02-28 20:48:57 +0000
commit3c017e402435ac8d89b7e158e042b05870f47e27 (patch)
treeae366dfd1bd8992cc742fcae111d41390a082d85 /gdb
parent80571bffe3b90a83994c059c774bee3bc6d56749 (diff)
downloadgdb-3c017e402435ac8d89b7e158e042b05870f47e27.zip
gdb-3c017e402435ac8d89b7e158e042b05870f47e27.tar.gz
gdb-3c017e402435ac8d89b7e158e042b05870f47e27.tar.bz2
* amd64-tdep.h: (amd64_collect_fxsave): New prototype.
* amd64-tdep.c (amd64_collect_fxsave): New function. (amd64_fill_fxsave): Simply call amd64_collect_fxsave.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog4
-rw-r--r--gdb/amd64-tdep.c26
-rw-r--r--gdb/amd64-tdep.h8
3 files changed, 32 insertions, 6 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index e999d4e..e741021 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
2004-02-28 Mark Kettenis <kettenis@gnu.org>
+ * amd64-tdep.h: (amd64_collect_fxsave): New prototype.
+ * amd64-tdep.c (amd64_collect_fxsave): New function.
+ (amd64_fill_fxsave): Simply call amd64_collect_fxsave.
+
* i387-tdep.h: Update copyright year.
(i387_collect_fxsave): New prototype.
* i387-tdep.c: Update copyright year.
diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c
index 0e44668..e0b2ca0 100644
--- a/gdb/amd64-tdep.c
+++ b/gdb/amd64-tdep.c
@@ -1169,6 +1169,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
reserved bits in *FXSAVE. */
@@ -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);
}
diff --git a/gdb/amd64-tdep.h b/gdb/amd64-tdep.h
index aff0c6a..042618b 100644
--- a/gdb/amd64-tdep.h
+++ b/gdb/amd64-tdep.h
@@ -64,6 +64,14 @@ extern void amd64_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 amd64_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
this for all registers. This function doesn't touch any of the
reserved bits in *FXSAVE. */