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 "defs.h"
#include "frame.h"
/* Prototypes for supply_gregset etc. */
#include "gregset.h"
\f
-/* This table must line up with REGISTER_NAME in "m68k-tdep.c". */
+/* This table must line up with gdbarch_register_name in "m68k-tdep.c". */
static const int regmap[] =
{
PT_D0, PT_D1, PT_D2, PT_D3, PT_D4, PT_D5, PT_D6, PT_D7,
int
getfpregs_supplies (int regno)
{
- return FP0_REGNUM <= regno && regno <= M68K_FPI_REGNUM;
+ return gdbarch_fp0_regnum (current_gdbarch) <= regno
+ && regno <= M68K_FPI_REGNUM;
}
/* Does the current host support the GETREGS request? */
char buf[MAX_REGISTER_SIZE];
int tid;
- if (CANNOT_FETCH_REGISTER (regno))
+ if (gdbarch_cannot_fetch_register (current_gdbarch, regno))
{
memset (buf, '\0', register_size (current_gdbarch, regno)); /* Supply zeroes */
regcache_raw_supply (regcache, regno, buf);
if (errno != 0)
{
sprintf (mess, "reading register %s (#%d)",
- REGISTER_NAME (regno), regno);
+ gdbarch_register_name (current_gdbarch, regno), regno);
perror_with_name (mess);
}
}
}
else
{
- for (regno = 0; regno < NUM_REGS; regno++)
+ for (regno = 0; regno < gdbarch_num_regs (current_gdbarch); regno++)
{
fetch_register (regcache, regno);
}
int tid;
char buf[MAX_REGISTER_SIZE];
- if (CANNOT_STORE_REGISTER (regno))
- {
- return;
- }
+ if (gdbarch_cannot_store_register (current_gdbarch, regno))
+ return;
/* Overload thread id onto process id */
tid = TIDGET (inferior_ptid);
if (errno != 0)
{
sprintf (mess, "writing register %s (#%d)",
- REGISTER_NAME (regno), regno);
+ gdbarch_register_name (current_gdbarch, regno), regno);
perror_with_name (mess);
}
}
}
else
{
- for (regno = 0; regno < NUM_REGS; regno++)
+ for (regno = 0; regno < gdbarch_num_regs (current_gdbarch); regno++)
{
store_register (regcache, regno);
}
const elf_greg_t *regp = (const elf_greg_t *) gregsetp;
int regi;
- for (regi = M68K_D0_REGNUM; regi <= SP_REGNUM; regi++)
+ for (regi = M68K_D0_REGNUM;
+ regi <= gdbarch_sp_regnum (current_gdbarch);
+ regi++)
regcache_raw_supply (regcache, regi, ®p[regmap[regi]]);
- regcache_raw_supply (regcache, PS_REGNUM, ®p[PT_SR]);
- regcache_raw_supply (regcache, PC_REGNUM, ®p[PT_PC]);
+ regcache_raw_supply (regcache, gdbarch_ps_regnum (current_gdbarch),
+ ®p[PT_SR]);
+ regcache_raw_supply (regcache,
+ gdbarch_pc_regnum (current_gdbarch), ®p[PT_PC]);
}
/* Fill register REGNO (if it is a general-purpose register) in
{
int regi;
- for (regi = FP0_REGNUM; regi < FP0_REGNUM + 8; regi++)
+ for (regi = gdbarch_fp0_regnum (current_gdbarch);
+ regi < gdbarch_fp0_regnum (current_gdbarch) + 8; regi++)
regcache_raw_supply (regcache, regi,
- FPREG_ADDR (fpregsetp, regi - FP0_REGNUM));
+ FPREG_ADDR (fpregsetp,
+ regi - gdbarch_fp0_regnum
+ (current_gdbarch)));
regcache_raw_supply (regcache, M68K_FPC_REGNUM, &fpregsetp->fpcntl[0]);
regcache_raw_supply (regcache, M68K_FPS_REGNUM, &fpregsetp->fpcntl[1]);
regcache_raw_supply (regcache, M68K_FPI_REGNUM, &fpregsetp->fpcntl[2]);
int i;
/* Fill in the floating-point registers. */
- for (i = FP0_REGNUM; i < FP0_REGNUM + 8; i++)
+ for (i = gdbarch_fp0_regnum (current_gdbarch);
+ i < gdbarch_fp0_regnum (current_gdbarch) + 8; i++)
if (regno == -1 || regno == i)
regcache_raw_collect (regcache, i,
- FPREG_ADDR (fpregsetp, i - FP0_REGNUM));
+ FPREG_ADDR (fpregsetp,
+ i - gdbarch_fp0_regnum
+ (current_gdbarch)));
/* Fill in the floating-point control registers. */
for (i = M68K_FPC_REGNUM; i <= M68K_FPI_REGNUM; i++)