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