1 /* Native-dependent code for BSD Unix running on ARM's, for GDB.
2 Copyright 1988, 1989, 1991, 1992, 1994, 1996, 1999 Free Software Foundation, Inc.
4 This file is part of GDB.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
23 #ifdef FETCH_INFERIOR_REGISTERS
24 #include <sys/types.h>
25 #include <sys/ptrace.h>
26 #include <machine/reg.h>
27 #include <machine/frame.h>
31 fetch_inferior_registers (regno)
34 struct reg inferior_registers;
35 struct fpreg inferior_fpregisters;
37 ptrace (PT_GETREGS, PIDGET (inferior_ptid),
38 (PTRACE_ARG3_TYPE) &inferior_registers, 0);
39 memcpy (®isters[REGISTER_BYTE (0)], &inferior_registers,
40 16 * sizeof (unsigned int));
41 memcpy (®isters[REGISTER_BYTE (PS_REGNUM)], &inferior_registers.r_cpsr,
42 sizeof (unsigned int));
43 ptrace (PT_GETFPREGS, PIDGET (inferior_ptid),
44 (PTRACE_ARG3_TYPE) &inferior_fpregisters, 0);
45 memcpy (®isters[REGISTER_BYTE (F0_REGNUM)], &inferior_fpregisters.fpr[0],
46 8 * sizeof (fp_reg_t));
47 memcpy (®isters[REGISTER_BYTE (FPS_REGNUM)],
48 &inferior_fpregisters.fpr_fpsr, sizeof (unsigned int));
53 store_inferior_registers (regno)
56 struct reg inferior_registers;
58 memcpy (&inferior_registers, ®isters[REGISTER_BYTE (0)],
59 16 * sizeof (unsigned int));
60 memcpy (&inferior_registers.r_cpsr, ®isters[REGISTER_BYTE (PS_REGNUM)],
61 sizeof (unsigned int));
62 ptrace (PT_SETREGS, PIDGET (inferior_ptid),
63 (PTRACE_ARG3_TYPE) &inferior_registers, 0);
65 /* XXX Set FP regs. */
75 fetch_core_registers (core_reg_sect, core_reg_size, which, ignore)
77 unsigned core_reg_size;
81 struct md_core *core_reg = (struct md_core *) core_reg_sect;
83 /* integer registers */
84 memcpy (®isters[REGISTER_BYTE (0)], &core_reg->intreg,
86 /* floating point registers */
91 #error Not FETCH_INFERIOR_REGISTERS
92 #endif /* !FETCH_INFERIOR_REGISTERS */
95 get_longjmp_target (CORE_ADDR *addr)