binutils-gdb/gdb/ia64-aix-nat.c
Andrew Cagney 23a6d36940 2004-07-21 Andrew Cagney <cagney@gnu.org>
Use regcache_raw_supply instead of supply_register.
	* regcache.h (supply_register): Delete declaration.
	* regcache.c (supply_register): Delete function.
	* wince.c (do_child_fetch_inferior_registers): Update.
	* win32-nat.c (do_child_fetch_inferior_registers)
	(fetch_elf_core_registers): Update.
	* v850ice.c (v850ice_fetch_registers): Update.
	* thread-db.c (thread_db_store_registers): Update.
	* sol-thread.c (sol_thread_store_registers): Update.
	* shnbsd-tdep.c (shnbsd_supply_reg): Update.
	* rs6000-nat.c (fetch_register): Update.
	* rom68k-rom.c (rom68k_supply_one_register): Update.
	* remote.c (remote_wait, remote_async_wait): Update.
	* remote-st.c (get_hex_regs): Update.
	* remote-sim.c (gdbsim_fetch_register): Update.
	* remote-sds.c (sds_fetch_registers): Update.
	* remote-rdp.c (remote_rdp_fetch_register): Update.
	* remote-rdi.c (arm_rdi_fetch_registers): Update.
	* remote-mips.c (mips_wait, mips_fetch_registers): Update.
	* remote-m32r-sdi.c (m32r_fetch_register): Update.
	* remote-hms.c (init_hms_cmds): Update.
	* remote-est.c (init_est_cmds): Update.
	* remote-e7000.c (get_hex_regs, fetch_regs_from_dump)
	(e7000_fetch_registers, sub2_from_pc, e7000_wait): Update.
	* ppcnbsd-tdep.c (ppcnbsd_supply_reg, ppcnbsd_supply_fpreg): Update.
	* ppc-linux-nat.c (fetch_altivec_register, fetch_spe_register)
	(fetch_register, supply_vrregset, supply_vrregset)
	(fetch_spe_registers): Update.
	* ppc-bdm.c (bdm_ppc_fetch_registers): Update.
	* monitor.c (monitor_supply_register): Update.
	* mipsv4-nat.c (supply_gregset, supply_fpregset): Update.
	* mipsnbsd-tdep.c (mipsnbsd_supply_reg)
	(mipsnbsd_supply_fpreg): Update.
	* mips-nat.c (fetch_inferior_registers)
	(fetch_core_registers): Update.
	* mips-linux-tdep.c (supply_32bit_reg, supply_gregset)
	(supply_fpregset, mips64_supply_gregset)
	(mips64_supply_fpregset): Update.
	* m68klinux-nat.c (fetch_register, supply_gregset)
	(supply_fpregset): Update.
	* m68k-tdep.c (supply_gregset, supply_fpregset): Update.
	* m32r-rom.c (init_m32r_cmds, init_mon2000_cmds): Update.
	* lynx-nat.c (fetch_inferior_registers, fetch_core_registers): Update.
	* irix5-nat.c (supply_gregset, supply_fpregset): Update.
	* infptrace.c (fetch_register): Update.
	* ia64-linux-nat.c (supply_gregset, supply_fpregset): Update.
	* ia64-aix-nat.c (supply_gregset, supply_fpregset): Update.
	* i386gnu-nat.c (fetch_fpregs, supply_gregset)
	(gnu_fetch_registers, gnu_store_registers): Update.
	* i386-nto-tdep.c (i386nto_supply_gregset): Update.
	* i386-linux-nat.c (fetch_register, supply_gregset)
	(dummy_sse_values): Update.
	* hpux-thread.c (hpux_thread_fetch_registers): Update.
	* hppah-nat.c (fetch_register): Update.
	* hppa-linux-nat.c (fetch_register, supply_gregset)
	(supply_fpregset): Update.
	* go32-nat.c (fetch_register): Update.
	* dve3900-rom.c (fetch_bitmapped_register)
	(_initialize_r3900_rom): Update.
	* cris-tdep.c (supply_gregset): Update.
	* abug-rom.c (init_abug_cmds): Update.
	* core-aout.c (fetch_core_registers): Update.
	* armnbsd-nat.c (supply_gregset, supply_fparegset)
	(fetch_register, fetch_fp_register): Update.
	* arm-linux-nat.c (fetch_nwfpe_single, fetch_nwfpe_none)
	(fetch_nwfpe_extended, fetch_fpregister, fetch_fpregs)
	(fetch_register, fetch_regs, supply_gregset, supply_fpregset): Update.
	* alphanbsd-tdep.c (fetch_core_registers): Update.
	* alpha-tdep.c (alpha_supply_int_regs, alpha_supply_fp_regs): Update.
	* alpha-nat.c (fetch_osf_core_registers)
	(fetch_osf_core_registers, fetch_osf_core_registers): Update.
	* aix-thread.c (supply_gprs64, supply_reg32, supply_fprs)
	(supply_sprs64, supply_sprs32, fetch_regs_kernel_thread): Update.
2004-07-22 01:31:49 +00:00

177 lines
5.8 KiB
C

/* Low level interface to IA-64 running AIX for GDB, the GNU debugger.
Copyright 2000, 2001, 2003 Free Software Foundation, Inc.
This file is part of GDB.
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
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
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., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "inferior.h"
#include "target.h"
#include "gdbcore.h"
#include "regcache.h"
#include <sys/procfs.h>
#include "symtab.h"
#include "bfd.h"
#include "symfile.h"
#include "objfiles.h"
#include <sys/types.h>
#include <fcntl.h>
#include "gdb_stat.h"
void
supply_gregset (prgregset_t *gregsetp)
{
int regi;
for (regi = IA64_GR0_REGNUM; regi <= IA64_GR31_REGNUM; regi++)
{
regcache_raw_supply (current_regcache, regi,
(char *) &(gregsetp->__gpr[regi - IA64_GR0_REGNUM]));
}
for (regi = IA64_BR0_REGNUM; regi <= IA64_BR7_REGNUM; regi++)
{
regcache_raw_supply (current_regcache, regi,
(char *) &(gregsetp->__br[regi - IA64_BR0_REGNUM]));
}
regcache_raw_supply (current_regcache, IA64_PSR_REGNUM,
(char *) &(gregsetp->__psr));
regcache_raw_supply (current_regcache, IA64_IP_REGNUM,
(char *) &(gregsetp->__ip));
regcache_raw_supply (current_regcache, IA64_CFM_REGNUM,
(char *) &(gregsetp->__ifs));
regcache_raw_supply (current_regcache, IA64_RSC_REGNUM,
(char *) &(gregsetp->__rsc));
regcache_raw_supply (current_regcache, IA64_BSP_REGNUM,
(char *) &(gregsetp->__bsp));
regcache_raw_supply (current_regcache, IA64_BSPSTORE_REGNUM,
(char *) &(gregsetp->__bspstore));
regcache_raw_supply (current_regcache, IA64_RNAT_REGNUM,
(char *) &(gregsetp->__rnat));
regcache_raw_supply (current_regcache, IA64_PFS_REGNUM,
(char *) &(gregsetp->__pfs));
regcache_raw_supply (current_regcache, IA64_UNAT_REGNUM,
(char *) &(gregsetp->__unat));
regcache_raw_supply (current_regcache, IA64_PR_REGNUM,
(char *) &(gregsetp->__preds));
regcache_raw_supply (current_regcache, IA64_CCV_REGNUM,
(char *) &(gregsetp->__ccv));
regcache_raw_supply (current_regcache, IA64_LC_REGNUM,
(char *) &(gregsetp->__lc));
regcache_raw_supply (current_regcache, IA64_EC_REGNUM,
(char *) &(gregsetp->__ec));
/* FIXME: __nats */
regcache_raw_supply (current_regcache, IA64_FPSR_REGNUM,
(char *) &(gregsetp->__fpsr));
/* These (for the most part) are pseudo registers and are obtained
by other means. Those that aren't are already handled by the
code above. */
for (regi = IA64_GR32_REGNUM; regi <= IA64_GR127_REGNUM; regi++)
deprecated_register_valid[regi] = 1;
for (regi = IA64_PR0_REGNUM; regi <= IA64_PR63_REGNUM; regi++)
deprecated_register_valid[regi] = 1;
for (regi = IA64_VFP_REGNUM; regi <= NUM_REGS; regi++)
deprecated_register_valid[regi] = 1;
}
void
fill_gregset (prgregset_t *gregsetp, int regno)
{
int regi;
#define COPY_REG(_fld_,_regi_) \
if ((regno == -1) || regno == _regi_) \
memcpy (&(gregsetp->_fld_), &deprecated_registers[DEPRECATED_REGISTER_BYTE (_regi_)], \
DEPRECATED_REGISTER_RAW_SIZE (_regi_))
for (regi = IA64_GR0_REGNUM; regi <= IA64_GR31_REGNUM; regi++)
{
COPY_REG (__gpr[regi - IA64_GR0_REGNUM], regi);
}
for (regi = IA64_BR0_REGNUM; regi <= IA64_BR7_REGNUM; regi++)
{
COPY_REG (__br[regi - IA64_BR0_REGNUM], regi);
}
COPY_REG (__psr, IA64_PSR_REGNUM);
COPY_REG (__ip, IA64_IP_REGNUM);
COPY_REG (__ifs, IA64_CFM_REGNUM);
COPY_REG (__rsc, IA64_RSC_REGNUM);
COPY_REG (__bsp, IA64_BSP_REGNUM);
/* Bad things happen if we don't update both bsp and bspstore at the
same time. */
if (regno == IA64_BSP_REGNUM || regno == -1)
{
memcpy (&(gregsetp->__bspstore),
&deprecated_registers[DEPRECATED_REGISTER_BYTE (IA64_BSP_REGNUM)],
DEPRECATED_REGISTER_RAW_SIZE (IA64_BSP_REGNUM));
memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (IA64_BSPSTORE_REGNUM)],
&deprecated_registers[DEPRECATED_REGISTER_BYTE (IA64_BSP_REGNUM)],
DEPRECATED_REGISTER_RAW_SIZE (IA64_BSP_REGNUM));
}
#if 0
/* We never actually write to bspstore, or we'd have to do the same thing
here too. */
COPY_REG (__bspstore, IA64_BSPSTORE_REGNUM);
#endif
COPY_REG (__rnat, IA64_RNAT_REGNUM);
COPY_REG (__pfs, IA64_PFS_REGNUM);
COPY_REG (__unat, IA64_UNAT_REGNUM);
COPY_REG (__preds, IA64_PR_REGNUM);
COPY_REG (__ccv, IA64_CCV_REGNUM);
COPY_REG (__lc, IA64_LC_REGNUM);
COPY_REG (__ec, IA64_EC_REGNUM);
/* FIXME: __nats */
COPY_REG (__fpsr, IA64_FPSR_REGNUM);
#undef COPY_REG
}
void
supply_fpregset (prfpregset_t *fpregsetp)
{
int regi;
for (regi = IA64_FR0_REGNUM; regi <= IA64_FR127_REGNUM; regi++)
regcache_raw_supply (current_regcache, regi,
(char *) &(fpregsetp->__fpr[regi - IA64_FR0_REGNUM]));
}
void
fill_fpregset (prfpregset_t *fpregsetp, int regno)
{
int regi;
char *to;
char *from;
for (regi = IA64_FR0_REGNUM; regi <= IA64_FR127_REGNUM; regi++)
{
if ((regno == -1) || (regno == regi))
{
from = (char *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (regi)];
to = (char *) &(fpregsetp->__fpr[regi - IA64_FR0_REGNUM]);
memcpy (to, from, DEPRECATED_REGISTER_RAW_SIZE (regi));
}
}
}