summaryrefslogtreecommitdiff
path: root/gdb/i387-tdep.c
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2002-05-12 21:16:08 +0000
committerMark Kettenis <kettenis@gnu.org>2002-05-12 21:16:08 +0000
commita09dcf1b69f8bb859fb8c81c117ba9903fa5f70c (patch)
treed51cec05b5c7da39de45b8acbabfee2c049e7e66 /gdb/i387-tdep.c
parentbd51146c16f164cbe0eca1d4f0d5d53e12a56454 (diff)
downloadgdb-a09dcf1b69f8bb859fb8c81c117ba9903fa5f70c.tar.gz
* i387-tdep.c (i387_supply_fxsave): Skip the SSE registers if
the're not supported by the current architecture. (i387_fill_fxsave): Likewise.
Diffstat (limited to 'gdb/i387-tdep.c')
-rw-r--r--gdb/i387-tdep.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/gdb/i387-tdep.c b/gdb/i387-tdep.c
index 000264f8a75..59b60d77a9d 100644
--- a/gdb/i387-tdep.c
+++ b/gdb/i387-tdep.c
@@ -1,6 +1,6 @@
/* Intel 387 floating point stuff.
- Copyright 1988, 1989, 1991, 1992, 1993, 1994, 1998, 1999, 2000, 2001
- Free Software Foundation, Inc.
+ Copyright 1988, 1989, 1991, 1992, 1993, 1994, 1998, 1999, 2000,
+ 2001, 2002 Free Software Foundation, Inc.
This file is part of GDB.
@@ -542,9 +542,12 @@ static int i387_tag (unsigned char *raw);
void
i387_supply_fxsave (char *fxsave)
{
- int i;
+ int i, last_regnum = MXCSR_REGNUM;
+
+ if (gdbarch_tdep (current_gdbarch)->num_xmm_regs == 0)
+ last_regnum = FOP_REGNUM;
- for (i = FP0_REGNUM; i <= MXCSR_REGNUM; i++)
+ for (i = FP0_REGNUM; i <= last_regnum; i++)
{
/* Most of the FPU control registers occupy only 16 bits in
the fxsave area. Give those a special treatment. */
@@ -601,9 +604,12 @@ i387_supply_fxsave (char *fxsave)
void
i387_fill_fxsave (char *fxsave, int regnum)
{
- int i;
+ int i, last_regnum = MXCSR_REGNUM;
+
+ if (gdbarch_tdep (current_gdbarch)->num_xmm_regs == 0)
+ last_regnum = FOP_REGNUM;
- for (i = FP0_REGNUM; i <= MXCSR_REGNUM; i++)
+ for (i = FP0_REGNUM; i <= last_regnum; i++)
if (regnum == -1 || regnum == i)
{
/* Most of the FPU control registers occupy only 16 bits in