]>
Commit | Line | Data |
---|---|---|
c906108c SS |
1 | /* Target machine definitions for GDB on a Sequent Symmetry under ptx |
2 | with Weitek 1167 and i387 support. | |
31a85ea2 AC |
3 | |
4 | Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 2000, | |
5 | 2003 Free Software Foundation, Inc. | |
6 | ||
c906108c SS |
7 | Symmetry version by Jay Vosburgh ([email protected]). |
8 | ||
c5aa993b | 9 | This file is part of GDB. |
c906108c | 10 | |
c5aa993b JM |
11 | This program is free software; you can redistribute it and/or modify |
12 | it under the terms of the GNU General Public License as published by | |
13 | the Free Software Foundation; either version 2 of the License, or | |
14 | (at your option) any later version. | |
c906108c | 15 | |
c5aa993b JM |
16 | This program is distributed in the hope that it will be useful, |
17 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 | GNU General Public License for more details. | |
c906108c | 20 | |
c5aa993b JM |
21 | You should have received a copy of the GNU General Public License |
22 | along with this program; if not, write to the Free Software | |
23 | Foundation, Inc., 59 Temple Place - Suite 330, | |
24 | Boston, MA 02111-1307, USA. */ | |
c906108c SS |
25 | |
26 | #ifndef TM_PTX_H | |
27 | #define TM_PTX_H 1 | |
28 | ||
29 | /* I don't know if this will work for cross-debugging, even if you do get | |
30 | a copy of the right include file. */ | |
31 | ||
32 | #include <sys/reg.h> | |
33 | ||
34 | #ifdef SEQUENT_PTX4 | |
8343f86c | 35 | #include "i386/tm-i386.h" |
c906108c | 36 | #else /* !SEQUENT_PTX4 */ |
641eda39 | 37 | #include "i386/tm-i386.h" |
c906108c SS |
38 | #endif |
39 | ||
c906108c SS |
40 | /* Amount PC must be decremented by after a breakpoint. This is often the |
41 | number of bytes in BREAKPOINT but not always (such as now). */ | |
42 | ||
43 | #undef DECR_PC_AFTER_BREAK | |
44 | #define DECR_PC_AFTER_BREAK 0 | |
45 | ||
c906108c SS |
46 | /* Number of machine registers */ |
47 | ||
48 | #undef NUM_REGS | |
49 | #define NUM_REGS 49 | |
50 | ||
51 | /* Initializer for an array of names of registers. There should be at least | |
52 | NUM_REGS strings in this initializer. Any excess ones are simply ignored. | |
53 | The order of the first 8 registers must match the compiler's numbering | |
54 | scheme (which is the same as the 386 scheme) and also regmap in the various | |
55 | *-nat.c files. */ | |
56 | ||
fc633446 | 57 | #undef REGISTER_NAME |
c906108c SS |
58 | #define REGISTER_NAMES { "eax", "ecx", "edx", "ebx", \ |
59 | "esp", "ebp", "esi", "edi", \ | |
60 | "eip", "eflags", "st0", "st1", \ | |
61 | "st2", "st3", "st4", "st5", \ | |
62 | "st6", "st7", "fp1", "fp2", \ | |
63 | "fp3", "fp4", "fp5", "fp6", \ | |
64 | "fp7", "fp8", "fp9", "fp10", \ | |
65 | "fp11", "fp12", "fp13", "fp14", \ | |
66 | "fp15", "fp16", "fp17", "fp18", \ | |
67 | "fp19", "fp20", "fp21", "fp22", \ | |
68 | "fp23", "fp24", "fp25", "fp26", \ | |
69 | "fp27", "fp28", "fp29", "fp30", \ | |
70 | "fp31" } | |
71 | ||
72 | /* Register numbers of various important registers. | |
73 | Note that some of these values are "real" register numbers, | |
74 | and correspond to the general registers of the machine, | |
75 | and some are "phony" register numbers which are too large | |
76 | to be actual register numbers as far as the user is concerned | |
77 | but do serve to get the desired values when passed to read_register. */ | |
78 | ||
79 | #define EAX_REGNUM 0 | |
80 | #define ECX_REGNUM 1 | |
81 | #define EDX_REGNUM 2 | |
82 | #define EBX_REGNUM 3 | |
83 | ||
84 | #define ESP_REGNUM 4 | |
85 | #define EBP_REGNUM 5 | |
86 | ||
87 | #define ESI_REGNUM 6 | |
88 | #define EDI_REGNUM 7 | |
89 | ||
90 | #define EIP_REGNUM 8 | |
91 | #define EFLAGS_REGNUM 9 | |
92 | ||
93 | #define ST0_REGNUM 10 | |
94 | #define ST1_REGNUM 11 | |
95 | #define ST2_REGNUM 12 | |
96 | #define ST3_REGNUM 13 | |
97 | ||
98 | #define ST4_REGNUM 14 | |
99 | #define ST5_REGNUM 15 | |
100 | #define ST6_REGNUM 16 | |
101 | #define ST7_REGNUM 17 | |
102 | ||
103 | #define FP1_REGNUM 18 /* first 1167 register */ | |
104 | /* Get %fp2 - %fp31 by addition, since they are contiguous */ | |
105 | ||
106 | #undef SP_REGNUM | |
107 | #define SP_REGNUM ESP_REGNUM /* Contains address of top of stack */ | |
108 | #undef FP_REGNUM | |
109 | #define FP_REGNUM EBP_REGNUM /* Contains address of executing stack frame */ | |
110 | #undef PC_REGNUM | |
111 | #define PC_REGNUM EIP_REGNUM /* Contains program counter */ | |
112 | #undef PS_REGNUM | |
113 | #define PS_REGNUM EFLAGS_REGNUM /* Contains processor status */ | |
114 | ||
115 | /* | |
116 | * For ptx, this is a little bit bizarre, since the register block | |
117 | * is below the u area in memory. This means that blockend here ends | |
118 | * up being negative (for the call from coredep.c) since the value in | |
119 | * u.u_ar0 will be less than KERNEL_U_ADDR (and coredep.c passes us | |
120 | * u.u_ar0 - KERNEL_U_ADDR in blockend). Since we also define | |
121 | * FETCH_INFERIOR_REGISTERS (and supply our own functions for that), | |
122 | * the core file case will be the only use of this function. | |
123 | */ | |
124 | ||
125 | #define REGISTER_U_ADDR(addr, blockend, regno) \ | |
126 | { (addr) = ptx_register_u_addr((blockend), (regno)); } | |
127 | ||
a14ed312 | 128 | extern int ptx_register_u_addr (int, int); |
c906108c SS |
129 | |
130 | /* Total amount of space needed to store our copies of the machine's | |
131 | register state, the array `registers'. 10 i*86 registers, 8 i387 | |
132 | registers, and 31 Weitek 1167 registers */ | |
133 | ||
134 | #undef REGISTER_BYTES | |
135 | #define REGISTER_BYTES ((10 * 4) + (8 * 10) + (31 * 4)) | |
136 | ||
c906108c SS |
137 | /* Largest value REGISTER_RAW_SIZE can have. */ |
138 | ||
139 | #undef MAX_REGISTER_RAW_SIZE | |
140 | #define MAX_REGISTER_RAW_SIZE 10 | |
141 | ||
142 | /* Nonzero if register N requires conversion | |
143 | from raw format to virtual format. */ | |
144 | ||
145 | #undef REGISTER_CONVERTIBLE | |
146 | #define REGISTER_CONVERTIBLE(N) \ | |
147 | ((N < ST0_REGNUM) ? 0 : \ | |
148 | (N < FP1_REGNUM) ? 1 : \ | |
149 | 0) | |
c5aa993b | 150 | |
c906108c SS |
151 | /* Convert data from raw format for register REGNUM |
152 | to virtual format for register REGNUM. */ | |
c5aa993b | 153 | extern const struct floatformat floatformat_i387_ext; /* from floatformat.h */ |
c906108c SS |
154 | |
155 | #undef REGISTER_CONVERT_TO_VIRTUAL | |
156 | #define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,TYPE,FROM,TO) \ | |
157 | ((REGNUM < ST0_REGNUM) ? (void)memcpy ((TO), (FROM), 4) : \ | |
158 | (REGNUM < FP1_REGNUM) ? (void)floatformat_to_double(&floatformat_i387_ext, \ | |
159 | (FROM),(TO)) : \ | |
160 | (void)memcpy ((TO), (FROM), 4)) | |
c5aa993b | 161 | |
c906108c SS |
162 | /* Convert data from virtual format for register REGNUM |
163 | to raw format for register REGNUM. */ | |
164 | ||
165 | #undef REGISTER_CONVERT_TO_RAW | |
166 | #define REGISTER_CONVERT_TO_RAW(TYPE,REGNUM,FROM,TO) \ | |
167 | ((REGNUM < ST0_REGNUM) ? (void)memcpy ((TO), (FROM), 4) : \ | |
168 | (REGNUM < FP1_REGNUM) ? (void)floatformat_from_double(&floatformat_i387_ext, \ | |
169 | (FROM),(TO)) : \ | |
170 | (void)memcpy ((TO), (FROM), 4)) | |
171 | ||
172 | /* Return the GDB type object for the "standard" data type | |
173 | of data in register N. */ | |
174 | /* | |
175 | * Note: the 1167 registers (the last line, builtin_type_float) are | |
176 | * generally used in pairs, with each pair being treated as a double. | |
177 | * It it also possible to use them singly as floats. I'm not sure how | |
178 | * in gdb to treat the register pair pseudo-doubles. -fubar | |
179 | */ | |
180 | #undef REGISTER_VIRTUAL_TYPE | |
181 | #define REGISTER_VIRTUAL_TYPE(N) \ | |
182 | ((N < ST0_REGNUM) ? builtin_type_int : \ | |
183 | (N < FP1_REGNUM) ? builtin_type_double : \ | |
184 | builtin_type_float) | |
185 | ||
186 | /* Extract from an array REGBUF containing the (raw) register state | |
187 | a function return value of type TYPE, and copy that, in virtual format, | |
188 | into VALBUF. */ | |
189 | ||
26e9b323 AC |
190 | #undef DEPRECATED_EXTRACT_RETURN_VALUE |
191 | #define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ | |
c906108c SS |
192 | symmetry_extract_return_value(TYPE, REGBUF, VALBUF) |
193 | ||
194 | /* | |
c5aa993b JM |
195 | #undef FRAME_FIND_SAVED_REGS |
196 | #define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \ | |
197 | { ptx_frame_find_saved_regs((frame_info), &(frame_saved_regs)); } | |
198 | */ | |
c906108c | 199 | |
c5aa993b | 200 | #endif /* ifndef TM_PTX_H */ |