/* Native debugging support for Intel x86 running DJGPP.
- Copyright (C) 1997, 1999, 2000, 2001, 2005, 2006, 2007
+ Copyright (C) 1997, 1999, 2000, 2001, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
Written by Robert Hoehne.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
+ the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA. */
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <fcntl.h>
static void go32_fetch_registers (struct regcache *, int regno);
static void store_register (const struct regcache *, int regno);
static void go32_store_registers (struct regcache *, int regno);
-static void go32_prepare_to_store (void);
+static void go32_prepare_to_store (struct regcache *);
static int go32_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len,
int write,
struct mem_attrib *attrib,
static void
fetch_register (struct regcache *regcache, int regno)
{
- if (regno < FP0_REGNUM)
+ if (regno < gdbarch_fp0_regnum (get_regcache_arch (regcache)))
regcache_raw_supply (regcache, regno,
(char *) &a_tss + regno_mapping[regno].tss_ofs);
else if (i386_fp_regnum_p (regno) || i386_fpc_regnum_p (regno))
fetch_register (regcache, regno);
else
{
- for (regno = 0; regno < FP0_REGNUM; regno++)
+ for (regno = 0;
+ regno < gdbarch_fp0_regnum (get_regcache_arch (regcache));
+ regno++)
fetch_register (regcache, regno);
i387_supply_fsave (regcache, -1, &npx);
}
static void
store_register (const struct regcache *regcache, int regno)
{
- if (regno < FP0_REGNUM)
+ if (regno < gdbarch_fp0_regnum (get_regcache_arch (regcache)))
regcache_raw_collect (regcache, regno,
(char *) &a_tss + regno_mapping[regno].tss_ofs);
else if (i386_fp_regnum_p (regno) || i386_fpc_regnum_p (regno))
store_register (regcache, regno);
else
{
- for (r = 0; r < FP0_REGNUM; r++)
+ for (r = 0; r < gdbarch_fp0_regnum (get_regcache_arch (regcache)); r++)
store_register (regcache, r);
i387_collect_fsave (regcache, -1, &npx);
}
}
static void
-go32_prepare_to_store (void)
+go32_prepare_to_store (struct regcache *regcache)
{
}