aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2003-08-23 13:58:18 +0000
committerMark Kettenis <kettenis@gnu.org>2003-08-23 13:58:18 +0000
commit0485f6ad303a1c0cbc03d83af4fa380987c0fc38 (patch)
tree65e98dbd548129b5dd80b6fc586ce556b337bfa1
parentc77161335bc01d9717915314b1249bc7d1986084 (diff)
downloadgdb-0485f6ad303a1c0cbc03d83af4fa380987c0fc38.zip
gdb-0485f6ad303a1c0cbc03d83af4fa380987c0fc38.tar.gz
gdb-0485f6ad303a1c0cbc03d83af4fa380987c0fc38.tar.bz2
* x86-64-tdep.c (x86_64_supply_fxsave): Add `regnum' argument.
Update comments. * x86-64-tdep.h (x86_64_supply_fxsave): Adjust prototype. Update comments. * x86-64-linux-tdep.c (fetch_core_registers): Adjust call to x86_64_supply_fxsave. * x86-64-linux-nat.c (supply_fpregset): Adjust call to x86_64_supply_fxsave. * amd64fbsd-nat.c (supply_fpregset): Adjust call to x86_64_supply_fxsave.
-rw-r--r--gdb/ChangeLog13
-rw-r--r--gdb/amd64fbsd-nat.c4
-rw-r--r--gdb/x86-64-linux-nat.c2
-rw-r--r--gdb/x86-64-linux-tdep.c2
-rw-r--r--gdb/x86-64-tdep.c17
-rw-r--r--gdb/x86-64-tdep.h11
6 files changed, 33 insertions, 16 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 4c5abca..dc207c6 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,16 @@
+2003-08-23 Mark Kettenis <kettenis@gnu.org>
+
+ * x86-64-tdep.c (x86_64_supply_fxsave): Add `regnum' argument.
+ Update comments.
+ * x86-64-tdep.h (x86_64_supply_fxsave): Adjust prototype. Update
+ comments.
+ * x86-64-linux-tdep.c (fetch_core_registers): Adjust call to
+ x86_64_supply_fxsave.
+ * x86-64-linux-nat.c (supply_fpregset): Adjust call to
+ x86_64_supply_fxsave.
+ * amd64fbsd-nat.c (supply_fpregset): Adjust call to
+ x86_64_supply_fxsave.
+
2003-08-23 Andreas Jaeger <aj@suse.de>
* x86-64-tdep.c (x86_64_supply_fxsave): Adjust call to
diff --git a/gdb/amd64fbsd-nat.c b/gdb/amd64fbsd-nat.c
index 71861d9..e90d8fa 100644
--- a/gdb/amd64fbsd-nat.c
+++ b/gdb/amd64fbsd-nat.c
@@ -124,7 +124,7 @@ fill_gregset (gregset_t *gregsetp, int regno)
void
supply_fpregset (fpregset_t *fpregsetp)
{
- x86_64_supply_fxsave ((char *) fpregsetp);
+ x86_64_supply_fxsave ((const char *) fpregsetp, -1);
}
/* Fill register REGNO (if it is a floating-point register) in
@@ -201,7 +201,7 @@ store_inferior_registers (int regno)
perror_with_name ("Couldn't get floating point status");
fill_fpregset (&fpregs, regno);
-
+
if (ptrace (PT_SETFPREGS, PIDGET (inferior_ptid),
(PTRACE_ARG3_TYPE) &fpregs, 0) == -1)
perror_with_name ("Couldn't write floating point status");
diff --git a/gdb/x86-64-linux-nat.c b/gdb/x86-64-linux-nat.c
index 66a1b68..d29d0f7 100644
--- a/gdb/x86-64-linux-nat.c
+++ b/gdb/x86-64-linux-nat.c
@@ -123,7 +123,7 @@ store_regs (int tid, int regno)
void
supply_fpregset (elf_fpregset_t *fpregsetp)
{
- x86_64_supply_fxsave ((char *) fpregsetp);
+ x86_64_supply_fxsave ((const char *) fpregsetp, -1);
}
/* Fill register REGNUM (if it is a floating-point or SSE register) in
diff --git a/gdb/x86-64-linux-tdep.c b/gdb/x86-64-linux-tdep.c
index 7aab1d4..e237f9e 100644
--- a/gdb/x86-64-linux-tdep.c
+++ b/gdb/x86-64-linux-tdep.c
@@ -123,7 +123,7 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
if (core_reg_size != 512)
warning ("Wrong size XMM register set in core file.");
else
- x86_64_supply_fxsave (core_reg_sect);
+ x86_64_supply_fxsave (core_reg_sect, -1);
break;
default:
diff --git a/gdb/x86-64-tdep.c b/gdb/x86-64-tdep.c
index 86cb2fc..e855503 100644
--- a/gdb/x86-64-tdep.c
+++ b/gdb/x86-64-tdep.c
@@ -1288,24 +1288,27 @@ x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
bits of these pointers (instead of just the 16-bits of the segment
selector). */
-/* Fill GDB's register array with the floating-point and SSE register
- values in *FXSAVE. This function masks off any of the reserved
- bits in *FXSAVE. */
+/* Fill register REGNUM in GDB's register cache with the appropriate
+ floating-point or SSE register value from *FXSAVE. If REGNUM is
+ -1, do this for all registers. This function masks off any of the
+ reserved bits in *FXSAVE. */
void
-x86_64_supply_fxsave (char *fxsave)
+x86_64_supply_fxsave (const char *fxsave, int regnum)
{
- i387_supply_fxsave (fxsave, -1);
+ i387_supply_fxsave (fxsave, regnum);
if (fxsave)
{
- supply_register (I387_FISEG_REGNUM, fxsave + 12);
+ if (regnum == -1 || regnum == I387_FISEG_REGNUM)
+ supply_register (I387_FISEG_REGNUM, fxsave + 12);
+ if (regnum == -1 || regnum == I387_FOSEG_REGNUM)
supply_register (I387_FOSEG_REGNUM, fxsave + 20);
}
}
/* Fill register REGNUM (if it is a floating-point or SSE register) in
- *FXSAVE with the value in GDB's register array. If REGNUM is -1, do
+ *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. */
diff --git a/gdb/x86-64-tdep.h b/gdb/x86-64-tdep.h
index 608219c..76bb3d3 100644
--- a/gdb/x86-64-tdep.h
+++ b/gdb/x86-64-tdep.h
@@ -48,14 +48,15 @@ struct frame_info;
void x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch);
-/* Fill GDB's register array with the floating-point and SSE register
- values in *FXSAVE. This function masks off any of the reserved
- bits in *FXSAVE. */
+/* Fill register REGNUM in GDB's register cache with the appropriate
+ floating-point or SSE register value from *FXSAVE. If REGNUM is
+ -1, do this for all registers. This function masks off any of the
+ reserved bits in *FXSAVE. */
-void x86_64_supply_fxsave (char *fxsave);
+void x86_64_supply_fxsave (const char *fxsave, int regnum);
/* Fill register REGNUM (if it is a floating-point or SSE register) in
- *FXSAVE with the value in GDB's register array. If REGNUM is -1, do
+ *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. */