1 /* Definitions to make GDB run on a Sequent Symmetry under dynix 3.0,
2 with Weitek 1167 and i387 support.
3 Copyright 1986, 1987, 1989, 1992 Free Software Foundation, Inc.
5 This file is part of GDB.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
21 /* Symmetry version by Jay Vosburgh (uunet!sequent!fubar) */
23 /* This machine doesn't have the siginterrupt call. */
24 #define NO_SIGINTERRUPT
26 #define HAVE_WAIT_STRUCT
28 /* XPT_DEBUG doesn't work yet under Dynix 3.0.12, but UNDEBUG does... */
29 /* #define PTRACE_ATTACH XPT_DEBUG
30 #define PTRACE_DETACH XPT_UNDEBUG
31 #define ATTACH_DETACH */
33 #define HOST_BYTE_ORDER LITTLE_ENDIAN
35 /* Get rid of any system-imposed stack limit if possible. */
37 #define SET_STACK_LIMIT_HUGE
39 /* This is the amount to subtract from u.u_ar0
40 to get the offset in the core file of the register values. */
42 #define KERNEL_U_ADDR (0x80000000 - (UPAGES * NBPG))
44 /* The magic numbers below are offsets into u_ar0 in the user struct.
45 They live in <machine/reg.h>. Gdb calls this macro with blockend
46 holding u.u_ar0 - KERNEL_U_ADDR. Only the registers listed are
47 saved in the u area (along with a few others that aren't useful
48 here. See <machine/reg.h>). */
50 #define REGISTER_U_ADDR(addr, blockend, regno) \
51 { struct user foo; /* needed for finding fpu regs */ \
54 addr = blockend + EAX * sizeof(int); break; \
56 addr = blockend + EDX * sizeof(int); break; \
58 addr = blockend + ECX * sizeof(int); break; \
61 ((int)&foo.u_fpusave.fpu_stack[0][0] - (int)&foo); \
65 ((int) &foo.u_fpusave.fpu_stack[1][0] - (int)&foo); \
68 addr = blockend + EBX * sizeof(int); break; \
70 addr = blockend + ESI * sizeof(int); break; \
72 addr = blockend + EDI * sizeof(int); break; \
75 ((int) &foo.u_fpusave.fpu_stack[2][0] - (int)&foo); \
79 ((int) &foo.u_fpusave.fpu_stack[3][0] - (int)&foo); \
81 case 10: /* st(4) */ \
83 ((int) &foo.u_fpusave.fpu_stack[4][0] - (int)&foo); \
85 case 11: /* st(5) */ \
87 ((int) &foo.u_fpusave.fpu_stack[5][0] - (int)&foo); \
89 case 12: /* st(6) */ \
91 ((int) &foo.u_fpusave.fpu_stack[6][0] - (int)&foo); \
93 case 13: /* st(7) */ \
95 ((int) &foo.u_fpusave.fpu_stack[7][0] - (int)&foo); \
98 addr = blockend + ESP * sizeof(int); break; \
100 addr = blockend + EBP * sizeof(int); break; \
102 addr = blockend + EIP * sizeof(int); break; \
104 addr = blockend + FLAGS * sizeof(int); break; \
114 case 27: /* fp10 */ \
115 case 28: /* fp11 */ \
116 case 29: /* fp12 */ \
117 case 30: /* fp13 */ \
118 case 31: /* fp14 */ \
119 case 32: /* fp15 */ \
120 case 33: /* fp16 */ \
121 case 34: /* fp17 */ \
122 case 35: /* fp18 */ \
123 case 36: /* fp19 */ \
124 case 37: /* fp20 */ \
125 case 38: /* fp21 */ \
126 case 39: /* fp22 */ \
127 case 40: /* fp23 */ \
128 case 41: /* fp24 */ \
129 case 42: /* fp25 */ \
130 case 43: /* fp26 */ \
131 case 44: /* fp27 */ \
132 case 45: /* fp28 */ \
133 case 46: /* fp29 */ \
134 case 47: /* fp30 */ \
135 case 48: /* fp31 */ \
137 ((int) &foo.u_fpasave.fpa_regs[(regno)-18] - (int)&foo); \
141 /* Override copies of {fetch,store}_inferior_registers in infptrace.c. */
143 #define FETCH_INFERIOR_REGISTERS
145 /* We must fetch all the regs before storing, since we store all at once. */
147 #define CHILD_PREPARE_TO_STORE() read_register_bytes (0, NULL, REGISTER_BYTES)
149 /* Interface definitions for kernel debugger KDB. */
150 /* This doesn't work... */
151 /* Map machine fault codes into signal numbers.
152 First subtract 0, divide by 4, then index in a table.
153 Faults for which the entry in this table is 0
154 are not handled by KDB; the program's own trap handler
155 gets to handle then. */
157 #define FAULT_CODE_ORIGIN 0
158 #define FAULT_CODE_UNITS 4
159 #define FAULT_TABLE \
160 { 0, SIGKILL, SIGSEGV, 0, 0, 0, 0, 0, \
161 0, 0, SIGTRAP, SIGTRAP, 0, 0, 0, 0, \
162 0, 0, 0, 0, 0, 0, 0, 0}
164 /* Start running with a stack stretching from BEG to END.
165 BEG and END should be symbols meaningful to the assembler.
166 This is used only for kdb. */
168 #define INIT_STACK(beg, end) \
169 { asm (".globl end"); \
170 asm ("movl $ end, %esp"); \
171 asm ("movl %ebp, $0"); }
173 /* Push the frame pointer register on the stack. */
174 #define PUSH_FRAME_PTR \
177 /* Copy the top-of-stack to the frame pointer register. */
178 #define POP_FRAME_PTR \
179 asm ("movl (%esp), %ebp");
181 /* After KDB is entered by a fault, push all registers
182 that GDB thinks about (all NUM_REGS of them),
183 so that they appear in order of ascending GDB register number.
184 The fault code will be on the stack beyond the last register. */
186 #define PUSH_REGISTERS \
189 { asm("pushl %eax"); \
192 asm("pushl %st(0)"); \
193 asm("pushl %st(1)"); \
197 asm("pushl %st(2)"); \
198 asm("pushl %st(3)"); \
199 asm("pushl %st(4)"); \
200 asm("pushl %st(5)"); \
201 asm("pushl %st(6)"); \
202 asm("pushl %st(7)"); \
206 asm("pushl %eflags"); \
216 asm("pushl %fp10"); \
217 asm("pushl %fp11"); \
218 asm("pushl %fp12"); \
219 asm("pushl %fp13"); \
220 asm("pushl %fp14"); \
221 asm("pushl %fp15"); \
222 asm("pushl %fp16"); \
223 asm("pushl %fp17"); \
224 asm("pushl %fp18"); \
225 asm("pushl %fp19"); \
226 asm("pushl %fp20"); \
227 asm("pushl %fp21"); \
228 asm("pushl %fp22"); \
229 asm("pushl %fp23"); \
230 asm("pushl %fp24"); \
231 asm("pushl %fp25"); \
232 asm("pushl %fp26"); \
233 asm("pushl %fp27"); \
234 asm("pushl %fp28"); \
235 asm("pushl %fp29"); \
236 asm("pushl %fp30"); \
237 asm("pushl %fp31"); \
240 /* Assuming the registers (including processor status) have been
241 pushed on the stack in order of ascending GDB register number,
242 restore them and return to the address in the saved PC register. */
244 #define POP_REGISTERS \
This page took 0.03374 seconds and 4 git commands to generate.