1 /* Functions specific to running gdb native on IA-64 running AIX.
2 Copyright 2000, 2001 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. */
26 #include <sys/procfs.h>
33 #include <sys/types.h>
38 supply_gregset (prgregset_t
*gregsetp
)
42 for (regi
= IA64_GR0_REGNUM
; regi
<= IA64_GR31_REGNUM
; regi
++)
44 supply_register (regi
,
45 (char *) &(gregsetp
->__gpr
[regi
- IA64_GR0_REGNUM
]));
48 for (regi
= IA64_BR0_REGNUM
; regi
<= IA64_BR7_REGNUM
; regi
++)
50 supply_register (regi
,
51 (char *) &(gregsetp
->__br
[regi
- IA64_BR0_REGNUM
]));
54 supply_register (IA64_PSR_REGNUM
, (char *) &(gregsetp
->__psr
));
55 supply_register (IA64_IP_REGNUM
, (char *) &(gregsetp
->__ip
));
56 supply_register (IA64_CFM_REGNUM
, (char *) &(gregsetp
->__ifs
));
57 supply_register (IA64_RSC_REGNUM
, (char *) &(gregsetp
->__rsc
));
58 supply_register (IA64_BSP_REGNUM
, (char *) &(gregsetp
->__bsp
));
59 supply_register (IA64_BSPSTORE_REGNUM
, (char *) &(gregsetp
->__bspstore
));
60 supply_register (IA64_RNAT_REGNUM
, (char *) &(gregsetp
->__rnat
));
61 supply_register (IA64_PFS_REGNUM
, (char *) &(gregsetp
->__pfs
));
62 supply_register (IA64_UNAT_REGNUM
, (char *) &(gregsetp
->__unat
));
63 supply_register (IA64_PR_REGNUM
, (char *) &(gregsetp
->__preds
));
64 supply_register (IA64_CCV_REGNUM
, (char *) &(gregsetp
->__ccv
));
65 supply_register (IA64_LC_REGNUM
, (char *) &(gregsetp
->__lc
));
66 supply_register (IA64_EC_REGNUM
, (char *) &(gregsetp
->__ec
));
68 supply_register (IA64_FPSR_REGNUM
, (char *) &(gregsetp
->__fpsr
));
70 /* These (for the most part) are pseudo registers and are obtained
71 by other means. Those that aren't are already handled by the
73 for (regi
= IA64_GR32_REGNUM
; regi
<= IA64_GR127_REGNUM
; regi
++)
74 register_valid
[regi
] = 1;
75 for (regi
= IA64_PR0_REGNUM
; regi
<= IA64_PR63_REGNUM
; regi
++)
76 register_valid
[regi
] = 1;
77 for (regi
= IA64_VFP_REGNUM
; regi
<= NUM_REGS
; regi
++)
78 register_valid
[regi
] = 1;
82 fill_gregset (prgregset_t
*gregsetp
, int regno
)
86 #define COPY_REG(_fld_,_regi_) \
87 if ((regno == -1) || regno == _regi_) \
88 memcpy (&(gregsetp->_fld_), ®isters[REGISTER_BYTE (_regi_)], \
89 REGISTER_RAW_SIZE (_regi_))
91 for (regi
= IA64_GR0_REGNUM
; regi
<= IA64_GR31_REGNUM
; regi
++)
93 COPY_REG (__gpr
[regi
- IA64_GR0_REGNUM
], regi
);
96 for (regi
= IA64_BR0_REGNUM
; regi
<= IA64_BR7_REGNUM
; regi
++)
98 COPY_REG (__br
[regi
- IA64_BR0_REGNUM
], regi
);
100 COPY_REG (__psr
, IA64_PSR_REGNUM
);
101 COPY_REG (__ip
, IA64_IP_REGNUM
);
102 COPY_REG (__ifs
, IA64_CFM_REGNUM
);
103 COPY_REG (__rsc
, IA64_RSC_REGNUM
);
104 COPY_REG (__bsp
, IA64_BSP_REGNUM
);
106 /* Bad things happen if we don't update both bsp and bspstore at the
108 if (regno
== IA64_BSP_REGNUM
|| regno
== -1)
110 memcpy (&(gregsetp
->__bspstore
),
111 ®isters
[REGISTER_BYTE (IA64_BSP_REGNUM
)],
112 REGISTER_RAW_SIZE (IA64_BSP_REGNUM
));
113 memcpy (®isters
[REGISTER_BYTE (IA64_BSPSTORE_REGNUM
)],
114 ®isters
[REGISTER_BYTE (IA64_BSP_REGNUM
)],
115 REGISTER_RAW_SIZE (IA64_BSP_REGNUM
));
119 /* We never actually write to bspstore, or we'd have to do the same thing
121 COPY_REG (__bspstore
, IA64_BSPSTORE_REGNUM
);
123 COPY_REG (__rnat
, IA64_RNAT_REGNUM
);
124 COPY_REG (__pfs
, IA64_PFS_REGNUM
);
125 COPY_REG (__unat
, IA64_UNAT_REGNUM
);
126 COPY_REG (__preds
, IA64_PR_REGNUM
);
127 COPY_REG (__ccv
, IA64_CCV_REGNUM
);
128 COPY_REG (__lc
, IA64_LC_REGNUM
);
129 COPY_REG (__ec
, IA64_EC_REGNUM
);
131 COPY_REG (__fpsr
, IA64_FPSR_REGNUM
);
136 supply_fpregset (prfpregset_t
*fpregsetp
)
140 for (regi
= IA64_FR0_REGNUM
; regi
<= IA64_FR127_REGNUM
; regi
++)
141 supply_register (regi
,
142 (char *) &(fpregsetp
->__fpr
[regi
- IA64_FR0_REGNUM
]));
146 fill_fpregset (prfpregset_t
*fpregsetp
, int regno
)
152 for (regi
= IA64_FR0_REGNUM
; regi
<= IA64_FR127_REGNUM
; regi
++)
154 if ((regno
== -1) || (regno
== regi
))
156 from
= (char *) ®isters
[REGISTER_BYTE (regi
)];
157 to
= (char *) &(fpregsetp
->__fpr
[regi
- IA64_FR0_REGNUM
]);
158 memcpy (to
, from
, REGISTER_RAW_SIZE (regi
));
This page took 0.032992 seconds and 4 git commands to generate.