1 /* Native-dependent code for GNU/Linux SPARC.
3 Copyright 2001, 2002 Free Software Foundation, Inc.
5 This file is part of GDB.
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.
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.
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. */
25 #include <sys/procfs.h>
27 /* Prototypes for supply_gregset etc. */
31 supply_gregset (elf_gregset_t
*gregsetp
)
33 elf_greg_t
*regp
= (elf_greg_t
*) gregsetp
;
36 for (i
= G0_REGNUM
; i
<= I7_REGNUM
; i
++)
37 supply_register (i
, (char *) (regp
+ (i
- G0_REGNUM
)));
39 supply_register (PS_REGNUM
, (char *) (regp
+ 32));
41 supply_register (PC_REGNUM
, (char *) (regp
+ 33));
42 supply_register (NPC_REGNUM
, (char *) (regp
+ 34));
43 supply_register (Y_REGNUM
, (char *) (regp
+ 35));
45 supply_register (WIM_REGNUM
, (char *) (regp
+ 36));
46 supply_register (TBR_REGNUM
, (char *) (regp
+ 37));
48 /* Fill inaccessible registers with zero. */
49 supply_register (CPS_REGNUM
, NULL
);
53 fill_gregset (elf_gregset_t
*gregsetp
, int regno
)
55 elf_greg_t
*regp
= (elf_greg_t
*) gregsetp
;
58 for (i
= G0_REGNUM
; i
<= I7_REGNUM
; i
++)
59 if (regno
== -1 || regno
== i
)
60 regcache_collect (i
, regp
+ (i
- G0_REGNUM
));
62 if (regno
== -1 || regno
== PS_REGNUM
)
63 regcache_collect (PS_REGNUM
, regp
+ 32);
65 if (regno
== -1 || regno
== PC_REGNUM
)
66 regcache_collect (PC_REGNUM
, regp
+ 33);
67 if (regno
== -1 || regno
== NPC_REGNUM
)
68 regcache_collect (NPC_REGNUM
, regp
+ 34);
69 if (regno
== -1 || regno
== Y_REGNUM
)
70 regcache_collect (Y_REGNUM
, regp
+ 35);
72 if (regno
== -1 || regno
== WIM_REGNUM
)
73 regcache_collect (WIM_REGNUM
, regp
+ 36);
74 if (regno
== -1 || regno
== TBR_REGNUM
)
75 regcache_collect (TBR_REGNUM
, regp
+ 37);
79 supply_fpregset (elf_fpregset_t
*fpregsetp
)
83 for (i
= FP0_REGNUM
; i
< FP0_REGNUM
+ 32; i
++)
84 supply_register (i
, (char *) &fpregsetp
->pr_fr
.pr_regs
[i
- FP0_REGNUM
]);
86 supply_register (FPS_REGNUM
, (char *) &fpregsetp
->pr_fsr
);
90 fill_fpregset (elf_fpregset_t
*fpregsetp
, int regno
)
94 for (i
= FP0_REGNUM
; i
< FP0_REGNUM
+ 32; i
++)
95 if (regno
== -1 || regno
== i
)
96 regcache_collect (i
, &fpregsetp
->pr_fr
.pr_regs
[i
- FP0_REGNUM
]);
98 if (regno
== -1 || regno
== FPS_REGNUM
)
99 regcache_collect (FPS_REGNUM
, &fpregsetp
->pr_fsr
);
This page took 0.030592 seconds and 4 git commands to generate.