1 /* Common target dependent code for GDB on Alpha systems running BSD.
2 Copyright 2000, 2001, 2002 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. */
24 #include "alpha-tdep.h"
25 #include "alphabsd-tdep.h"
27 /* Number of general-purpose registers. */
30 /* Number of floating-point registers. */
33 /* Conviently, GDB uses the same register numbering as the
34 ptrace register structure used by BSD on Alpha. */
37 alphabsd_supply_reg (char *regs
, int regno
)
41 for (i
= 0; i
< NUM_GREGS
; i
++)
43 if (i
== regno
|| regno
== -1)
45 if (CANNOT_FETCH_REGISTER (i
))
46 supply_register (i
, NULL
);
48 supply_register (i
, regs
+ (i
* 8));
52 /* The PC travels in the ZERO slot. */
53 if (regno
== PC_REGNUM
|| regno
== -1)
54 supply_register (PC_REGNUM
, regs
+ (31 * 8));
58 alphabsd_fill_reg (char *regs
, int regno
)
62 for (i
= 0; i
< NUM_GREGS
; i
++)
63 if ((regno
== i
|| regno
== -1) && ! CANNOT_STORE_REGISTER (i
))
64 regcache_collect (i
, regs
+ (i
* 8));
66 /* The PC travels in the ZERO slot. */
67 if (regno
== PC_REGNUM
|| regno
== -1)
68 regcache_collect (PC_REGNUM
, regs
+ (31 * 8));
72 alphabsd_supply_fpreg (char *fpregs
, int regno
)
76 for (i
= FP0_REGNUM
; i
< FP0_REGNUM
+ NUM_FPREGS
; i
++)
78 if (i
== regno
|| regno
== -1)
80 if (CANNOT_FETCH_REGISTER (i
))
81 supply_register (i
, NULL
);
83 supply_register (i
, fpregs
+ ((i
- FP0_REGNUM
) * 8));
87 if (regno
== ALPHA_FPCR_REGNUM
|| regno
== -1)
88 supply_register (ALPHA_FPCR_REGNUM
, fpregs
+ (32 * 8));
92 alphabsd_fill_fpreg (char *fpregs
, int regno
)
96 for (i
= FP0_REGNUM
; i
< FP0_REGNUM
+ NUM_FPREGS
; i
++)
97 if ((regno
== i
|| regno
== -1) && ! CANNOT_STORE_REGISTER (i
))
98 regcache_collect (i
, fpregs
+ ((i
- FP0_REGNUM
) * 8));
100 if (regno
== ALPHA_FPCR_REGNUM
|| regno
== -1)
101 regcache_collect (ALPHA_FPCR_REGNUM
, fpregs
+ (32 * 8));
This page took 0.031232 seconds and 4 git commands to generate.