Commit | Line | Data |
---|---|---|
e7a42bc8 | 1 | /* Native-dependent code for BSD Unix running on ARM's, for GDB. |
34e8f22d RE |
2 | Copyright 1988, 1989, 1991, 1992, 1994, 1996, 1999, 2002 |
3 | Free Software Foundation, Inc. | |
e7a42bc8 FN |
4 | |
5 | This file is part of GDB. | |
6 | ||
7 | This program is free software; you can redistribute it and/or modify | |
8 | it under the terms of the GNU General Public License as published by | |
9 | the Free Software Foundation; either version 2 of the License, or | |
10 | (at your option) any later version. | |
11 | ||
12 | This program is distributed in the hope that it will be useful, | |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | GNU General Public License for more details. | |
16 | ||
17 | You should have received a copy of the GNU General Public License | |
18 | along with this program; if not, write to the Free Software | |
19 | Foundation, Inc., 59 Temple Place - Suite 330, | |
20 | Boston, MA 02111-1307, USA. */ | |
21 | ||
22 | #include "defs.h" | |
23 | ||
34e8f22d RE |
24 | #include "arm-tdep.h" |
25 | ||
e7a42bc8 FN |
26 | #ifdef FETCH_INFERIOR_REGISTERS |
27 | #include <sys/types.h> | |
28 | #include <sys/ptrace.h> | |
29 | #include <machine/reg.h> | |
30 | #include <machine/frame.h> | |
31 | #include "inferior.h" | |
32 | ||
33 | void | |
34 | fetch_inferior_registers (regno) | |
35 | int regno; | |
36 | { | |
37 | struct reg inferior_registers; | |
38 | struct fpreg inferior_fpregisters; | |
39 | ||
747fe712 RE |
40 | ptrace (PT_GETREGS, PIDGET (inferior_ptid), |
41 | (PTRACE_ARG3_TYPE) &inferior_registers, 0); | |
e7a42bc8 FN |
42 | memcpy (®isters[REGISTER_BYTE (0)], &inferior_registers, |
43 | 16 * sizeof (unsigned int)); | |
34e8f22d RE |
44 | memcpy (®isters[REGISTER_BYTE (ARM_PS_REGNUM)], |
45 | &inferior_registers.r_cpsr, | |
e7a42bc8 | 46 | sizeof (unsigned int)); |
747fe712 RE |
47 | ptrace (PT_GETFPREGS, PIDGET (inferior_ptid), |
48 | (PTRACE_ARG3_TYPE) &inferior_fpregisters, 0); | |
34e8f22d RE |
49 | memcpy (®isters[REGISTER_BYTE (ARM_F0_REGNUM)], |
50 | &inferior_fpregisters.fpr[0], | |
e7a42bc8 | 51 | 8 * sizeof (fp_reg_t)); |
34e8f22d | 52 | memcpy (®isters[REGISTER_BYTE (ARM_FPS_REGNUM)], |
e7a42bc8 FN |
53 | &inferior_fpregisters.fpr_fpsr, sizeof (unsigned int)); |
54 | registers_fetched (); | |
55 | } | |
56 | ||
57 | void | |
58 | store_inferior_registers (regno) | |
59 | int regno; | |
60 | { | |
61 | struct reg inferior_registers; | |
62 | ||
63 | memcpy (&inferior_registers, ®isters[REGISTER_BYTE (0)], | |
64 | 16 * sizeof (unsigned int)); | |
34e8f22d RE |
65 | memcpy (&inferior_registers.r_cpsr, |
66 | ®isters[REGISTER_BYTE (ARM_PS_REGNUM)], | |
e7a42bc8 | 67 | sizeof (unsigned int)); |
747fe712 RE |
68 | ptrace (PT_SETREGS, PIDGET (inferior_ptid), |
69 | (PTRACE_ARG3_TYPE) &inferior_registers, 0); | |
e7a42bc8 FN |
70 | |
71 | /* XXX Set FP regs. */ | |
72 | } | |
73 | ||
74 | struct md_core | |
75 | { | |
76 | struct reg intreg; | |
77 | struct fpreg freg; | |
78 | }; | |
79 | ||
80 | void | |
81 | fetch_core_registers (core_reg_sect, core_reg_size, which, ignore) | |
82 | char *core_reg_sect; | |
83 | unsigned core_reg_size; | |
84 | int which; | |
85 | CORE_ADDR ignore; | |
86 | { | |
87 | struct md_core *core_reg = (struct md_core *) core_reg_sect; | |
88 | ||
89 | /* integer registers */ | |
90 | memcpy (®isters[REGISTER_BYTE (0)], &core_reg->intreg, | |
91 | sizeof (struct reg)); | |
92 | /* floating point registers */ | |
93 | /* XXX */ | |
94 | } | |
95 | ||
96 | #else | |
97 | #error Not FETCH_INFERIOR_REGISTERS | |
98 | #endif /* !FETCH_INFERIOR_REGISTERS */ | |
99 | ||
100 | int | |
101 | get_longjmp_target (CORE_ADDR *addr) | |
102 | { | |
103 | return 0; | |
104 | } |