1 /* Target machine definitions for GDB on a Sequent Symmetry under ptx
2 with Weitek 1167 and i387 support.
3 Copyright 1986, 1987, 1989, 1991, 1992, 1993 Free Software Foundation, Inc.
4 Symmetry version by Jay Vosburgh (fubar@sequent.com).
6 This file is part of GDB.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
22 /* I don't know if this will work for cross-debugging, even if you do get
23 a copy of the right include file. */
27 #define SDB_REG_TO_REGNUM(value) ptx_coff_regno_to_gdb(value)
28 extern int ptx_coff_regno_to_gdb();
31 #define START_INFERIOR_TRAPS_EXPECTED 2
33 /* Amount PC must be decremented by after a breakpoint.
34 This is often the number of bytes in BREAKPOINT
37 #define DECR_PC_AFTER_BREAK 0
40 #include "i386/tm-i386v4.h"
41 #else /* !SEQUENT_PTX4 */
42 #include "i386/tm-i386v.h"
46 --- this code can
't be used unless we know we are running native,
47 since it uses host specific ptrace calls.
48 /* code for 80387 fpu. Functions are from i386-dep.c, copied into
51 #define FLOAT_INFO { i386_float_info(); }
54 /* Number of machine registers */
58 /* Initializer for an array of names of registers.
59 There should be NUM_REGS strings in this initializer. */
62 #define REGISTER_NAMES { "eax", "ecx", "edx", "ebx", \
63 "esp", "ebp", "esi", "edi", \
64 "eip", "eflags", "st0", "st1", "st2", \
65 "st3", "st4", "st5", "st6", "st7", \
66 "fp1", "fp2", "fp3", "fp4", "fp5", "fp6", "fp7", \
67 "fp8", "fp9", "fp10", "fp11", "fp12", \
68 "fp13", "fp14", "fp15", "fp16", "fp17", \
69 "fp18", "fp19", "fp20", "fp21", "fp22", \
70 "fp23", "fp24", "fp25", "fp26", "fp27", \
71 "fp28", "fp29", "fp30", "fp31" }
73 /* Register numbers of various important registers.
74 Note that some of these values are "real" register numbers,
75 and correspond to the general registers of the machine,
76 and some are "phony" register numbers which are too large
77 to be actual register numbers as far as the user is concerned
78 but do serve to get the desired values when passed to read_register. */
92 #define EFLAGS_REGNUM 9
100 #define ST5_REGNUM 15
101 #define ST6_REGNUM 16
102 #define ST7_REGNUM 17
104 #define FP1_REGNUM 18 /* first 1167 register */
105 /* Get %fp2 - %fp31 by addition, since they are contiguous */
108 #define SP_REGNUM ESP_REGNUM /* Contains address of top of stack */
110 #define FP_REGNUM EBP_REGNUM /* Contains address of executing stack frame */
112 #define PC_REGNUM EIP_REGNUM /* Contains program counter */
114 #define PS_REGNUM EFLAGS_REGNUM /* Contains processor status */
117 * For ptx, this is a little bit bizarre, since the register block
118 * is below the u area in memory. This means that blockend here ends
119 * up being negative (for the call from coredep.c) since the value in
120 * u.u_ar0 will be less than KERNEL_U_ADDR (and coredep.c passes us
121 * u.u_ar0 - KERNEL_U_ADDR in blockend). Since we also define
122 * FETCH_INFERIOR_REGISTERS (and supply our own functions for that),
123 * the core file case will be the only use of this function.
126 #define REGISTER_U_ADDR(addr, blockend, regno) \
127 { (addr) = ptx_register_u_addr((blockend), (regno)); }
130 ptx_register_u_addr PARAMS ((int, int));
133 /* Total amount of space needed to store our copies of the machine's
134 register state
, the array `registers
'. */
135 /* 10 i386 registers, 8 i387 registers, and 31 Weitek 1167 registers */
136 #undef REGISTER_BYTES
137 #define REGISTER_BYTES ((10 * 4) + (8 * 10) + (31 * 4))
139 /* Index within `registers' of the first byte of the space
for
143 #define REGISTER_BYTE(N) \
144 ((N < ST0_REGNUM) ? (N * 4) : \
145 (N < FP1_REGNUM) ? (40 + ((N - ST0_REGNUM) * 10)) : \
146 (40 + 80 + ((N - FP1_REGNUM) * 4)))
148 /* Number of bytes of storage in the actual machine representation
149 * for register N. All registers are 4 bytes, except 387 st(0) - st(7),
150 * which are 80 bits each.
153 #undef REGISTER_RAW_SIZE
154 #define REGISTER_RAW_SIZE(N) \
155 ((N < ST0_REGNUM) ? 4 : \
156 (N < FP1_REGNUM) ? 10 : \
159 /* Largest value REGISTER_RAW_SIZE can have. */
161 #undef MAX_REGISTER_RAW_SIZE
162 #define MAX_REGISTER_RAW_SIZE 10
164 /* Nonzero if register N requires conversion
165 from raw format to virtual format. */
167 #undef REGISTER_CONVERTIBLE
168 #define REGISTER_CONVERTIBLE(N) \
169 ((N < ST0_REGNUM) ? 0 : \
170 (N < FP1_REGNUM) ? 1 : \
173 /* Convert data from raw format for register REGNUM
174 to virtual format for register REGNUM. */
175 extern const struct floatformat floatformat_i387_ext
; /* from floatformat.h */
177 #undef REGISTER_CONVERT_TO_VIRTUAL
178 #define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,TYPE,FROM,TO) \
179 ((REGNUM < ST0_REGNUM) ? (void)memcpy ((TO), (FROM), 4) : \
180 (REGNUM < FP1_REGNUM) ? (void)floatformat_to_double(&floatformat_i387_ext, \
182 (void)memcpy ((TO), (FROM), 4))
184 /* Convert data from virtual format for register REGNUM
185 to raw format for register REGNUM. */
187 #undef REGISTER_CONVERT_TO_RAW
188 #define REGISTER_CONVERT_TO_RAW(TYPE,REGNUM,FROM,TO) \
189 ((REGNUM < ST0_REGNUM) ? (void)memcpy ((TO), (FROM), 4) : \
190 (REGNUM < FP1_REGNUM) ? (void)floatformat_from_double(&floatformat_i387_ext, \
192 (void)memcpy ((TO), (FROM), 4))
194 /* Return the GDB type object for the "standard" data type
195 of data in register N. */
197 * Note: the 1167 registers (the last line, builtin_type_float) are
198 * generally used in pairs, with each pair being treated as a double.
199 * It it also possible to use them singly as floats. I'm not sure how
200 * in gdb to treat the register pair pseudo-doubles. -fubar
202 #undef REGISTER_VIRTUAL_TYPE
203 #define REGISTER_VIRTUAL_TYPE(N) \
204 ((N < ST0_REGNUM) ? builtin_type_int : \
205 (N < FP1_REGNUM) ? builtin_type_double : \
208 /* Extract from an array REGBUF containing the (raw) register state
209 a function return value of type TYPE, and copy that, in virtual format,
212 #undef EXTRACT_RETURN_VALUE
213 #define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
214 symmetry_extract_return_value(TYPE, REGBUF, VALBUF)
218 * Removed extra PUSH_DUMMY_FRAME, et al: it was identical to the
219 * i386-tdep.c version.
223 print_387_control_word
PARAMS ((unsigned int));
226 print_387_status_word
PARAMS ((unsigned int));
229 #undef FRAME_FIND_SAVED_REGS
230 #define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
231 { ptx_frame_find_saved_regs((frame_info), &(frame_saved_regs)); }