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, 1994, 1995, 2000
4 Free Software Foundation, Inc.
5 Symmetry version by Jay Vosburgh (fubar@sequent.com).
7 This file is part of GDB.
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.
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.
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. */
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. */
33 #include "i386/tm-i386.h"
34 #else /* !SEQUENT_PTX4 */
35 #include "i386/tm-i386.h"
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). */
41 #undef DECR_PC_AFTER_BREAK
42 #define DECR_PC_AFTER_BREAK 0
45 -- -this code can
't be used unless we know we are running native,
46 since it uses host specific ptrace calls.
47 /* code for 80387 fpu. Functions are from i386-dep.c, copied into
50 #define FLOAT_INFO { i386_float_info(); }
53 /* Number of machine registers */
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
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", \
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. */
98 #define EFLAGS_REGNUM 9
100 #define ST0_REGNUM 10
101 #define ST1_REGNUM 11
102 #define ST2_REGNUM 12
103 #define ST3_REGNUM 13
105 #define ST4_REGNUM 14
106 #define ST5_REGNUM 15
107 #define ST6_REGNUM 16
108 #define ST7_REGNUM 17
110 #define FP1_REGNUM 18 /* first 1167 register */
111 /* Get %fp2 - %fp31 by addition, since they are contiguous */
114 #define SP_REGNUM ESP_REGNUM /* Contains address of top of stack */
116 #define FP_REGNUM EBP_REGNUM /* Contains address of executing stack frame */
118 #define PC_REGNUM EIP_REGNUM /* Contains program counter */
120 #define PS_REGNUM EFLAGS_REGNUM /* Contains processor status */
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.
132 #define REGISTER_U_ADDR(addr, blockend, regno) \
133 { (addr) = ptx_register_u_addr((blockend), (regno)); }
135 extern int ptx_register_u_addr (int, int);
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 */
141 #undef REGISTER_BYTES
142 #define REGISTER_BYTES ((10 * 4) + (8 * 10) + (31 * 4))
144 /* Largest value REGISTER_RAW_SIZE can have. */
146 #undef MAX_REGISTER_RAW_SIZE
147 #define MAX_REGISTER_RAW_SIZE 10
149 /* Nonzero if register N requires conversion
150 from raw format to virtual format. */
152 #undef REGISTER_CONVERTIBLE
153 #define REGISTER_CONVERTIBLE(N) \
154 ((N < ST0_REGNUM) ? 0 : \
155 (N < FP1_REGNUM) ? 1 : \
158 /* Convert data from raw format for register REGNUM
159 to virtual format for register REGNUM. */
160 extern const struct floatformat floatformat_i387_ext
; /* from floatformat.h */
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, \
167 (void)memcpy ((TO), (FROM), 4))
169 /* Convert data from virtual format for register REGNUM
170 to raw format for register REGNUM. */
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, \
177 (void)memcpy ((TO), (FROM), 4))
179 /* Return the GDB type object for the "standard" data type
180 of data in register N. */
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
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 : \
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,
197 #undef DEPRECATED_EXTRACT_RETURN_VALUE
198 #define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
199 symmetry_extract_return_value(TYPE, REGBUF, VALBUF)
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)); }
207 #endif /* ifndef TM_PTX_H */