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
, inferior_pid
, (PTRACE_ARG3_TYPE
) &inferior_registers
, 0);
38 memcpy (®isters
[REGISTER_BYTE (0)], &inferior_registers
,
39 16 * sizeof (unsigned int));
40 memcpy (®isters
[REGISTER_BYTE (PS_REGNUM
)], &inferior_registers
.r_cpsr
,
41 sizeof (unsigned int));
42 ptrace (PT_GETFPREGS
, inferior_pid
, (PTRACE_ARG3_TYPE
) &inferior_fpregisters
,
44 memcpy (®isters
[REGISTER_BYTE (F0_REGNUM
)], &inferior_fpregisters
.fpr
[0],
45 8 * sizeof (fp_reg_t
));
46 memcpy (®isters
[REGISTER_BYTE (FPS_REGNUM
)],
47 &inferior_fpregisters
.fpr_fpsr
, sizeof (unsigned int));
52 store_inferior_registers (regno
)
55 struct reg inferior_registers
;
57 memcpy (&inferior_registers
, ®isters
[REGISTER_BYTE (0)],
58 16 * sizeof (unsigned int));
59 memcpy (&inferior_registers
.r_cpsr
, ®isters
[REGISTER_BYTE (PS_REGNUM
)],
60 sizeof (unsigned int));
61 ptrace (PT_SETREGS
, inferior_pid
, (PTRACE_ARG3_TYPE
) &inferior_registers
, 0);
63 /* XXX Set FP regs. */
73 fetch_core_registers (core_reg_sect
, core_reg_size
, which
, ignore
)
75 unsigned core_reg_size
;
79 struct md_core
*core_reg
= (struct md_core
*) core_reg_sect
;
81 /* integer registers */
82 memcpy (®isters
[REGISTER_BYTE (0)], &core_reg
->intreg
,
84 /* floating point registers */
89 #error Not FETCH_INFERIOR_REGISTERS
90 #endif /* !FETCH_INFERIOR_REGISTERS */
93 get_longjmp_target (CORE_ADDR
*addr
)