1 |
578 |
markom |
/* OBSOLETE /* Parameters for a Sun 386i target machine, for GDB, the GNU debugger. */
|
2 |
|
|
/* OBSOLETE Copyright 1986, 1987, 1991, 1992, 1993, 1994, 1995, 1999, 2000 */
|
3 |
|
|
/* OBSOLETE Free Software Foundation, Inc. */
|
4 |
|
|
/* OBSOLETE */
|
5 |
|
|
/* OBSOLETE This file is part of GDB. */
|
6 |
|
|
/* OBSOLETE */
|
7 |
|
|
/* OBSOLETE This program is free software; you can redistribute it and/or modify */
|
8 |
|
|
/* OBSOLETE it under the terms of the GNU General Public License as published by */
|
9 |
|
|
/* OBSOLETE the Free Software Foundation; either version 2 of the License, or */
|
10 |
|
|
/* OBSOLETE (at your option) any later version. */
|
11 |
|
|
/* OBSOLETE */
|
12 |
|
|
/* OBSOLETE This program is distributed in the hope that it will be useful, */
|
13 |
|
|
/* OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
14 |
|
|
/* OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
15 |
|
|
/* OBSOLETE GNU General Public License for more details. */
|
16 |
|
|
/* OBSOLETE */
|
17 |
|
|
/* OBSOLETE You should have received a copy of the GNU General Public License */
|
18 |
|
|
/* OBSOLETE along with this program; if not, write to the Free Software */
|
19 |
|
|
/* OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, */
|
20 |
|
|
/* OBSOLETE Boston, MA 02111-1307, USA. */ */
|
21 |
|
|
/* OBSOLETE */
|
22 |
|
|
/* OBSOLETE #if !defined (TM_SUN386_H) */
|
23 |
|
|
/* OBSOLETE #define TM_SUN386_H 1 */
|
24 |
|
|
/* OBSOLETE */
|
25 |
|
|
/* OBSOLETE #include "regcache.h" */
|
26 |
|
|
/* OBSOLETE #include "i386/tm-i386.h" */
|
27 |
|
|
/* OBSOLETE */
|
28 |
|
|
/* OBSOLETE #ifndef sun386 */
|
29 |
|
|
/* OBSOLETE #define sun386 */
|
30 |
|
|
/* OBSOLETE #endif */
|
31 |
|
|
/* OBSOLETE #define SUNOS4 */
|
32 |
|
|
/* OBSOLETE #define USE_MACHINE_REG_H */
|
33 |
|
|
/* OBSOLETE */
|
34 |
|
|
/* OBSOLETE /* Perhaps some day this will work even without the following #define */ */
|
35 |
|
|
/* OBSOLETE #define COFF_ENCAPSULATE */
|
36 |
|
|
/* OBSOLETE */
|
37 |
|
|
/* OBSOLETE #ifdef COFF_ENCAPSULATE */
|
38 |
|
|
/* OBSOLETE /* Avoid conflicts between our include files and <sys/exec.h> */
|
39 |
|
|
/* OBSOLETE (maybe not needed anymore). */ */
|
40 |
|
|
/* OBSOLETE #define _EXEC_ */
|
41 |
|
|
/* OBSOLETE #endif */
|
42 |
|
|
/* OBSOLETE */
|
43 |
|
|
/* OBSOLETE /* sun386 ptrace seems unable to change the frame pointer */ */
|
44 |
|
|
/* OBSOLETE #define PTRACE_FP_BUG */
|
45 |
|
|
/* OBSOLETE */
|
46 |
|
|
/* OBSOLETE /* Address of end of stack space. */ */
|
47 |
|
|
/* OBSOLETE */
|
48 |
|
|
/* OBSOLETE #define STACK_END_ADDR 0xfc000000 */
|
49 |
|
|
/* OBSOLETE */
|
50 |
|
|
/* OBSOLETE /* Number of machine registers */ */
|
51 |
|
|
/* OBSOLETE */
|
52 |
|
|
/* OBSOLETE #undef NUM_REGS */
|
53 |
|
|
/* OBSOLETE #define NUM_REGS 35 */
|
54 |
|
|
/* OBSOLETE */
|
55 |
|
|
/* OBSOLETE /* Initializer for an array of names of registers. There should be NUM_REGS */
|
56 |
|
|
/* OBSOLETE strings in this initializer. The order of the first 8 registers must match */
|
57 |
|
|
/* OBSOLETE the compiler's numbering scheme (which is the same as the 386 scheme) also, */
|
58 |
|
|
/* OBSOLETE this table must match regmap in i386-pinsn.c. */ */
|
59 |
|
|
/* OBSOLETE */
|
60 |
|
|
/* OBSOLETE #undef REGISTER_NAMES */
|
61 |
|
|
/* OBSOLETE #define REGISTER_NAMES { "gs", "fs", "es", "ds", \ */
|
62 |
|
|
/* OBSOLETE "edi", "esi", "ebp", "esp", \ */
|
63 |
|
|
/* OBSOLETE "ebx", "edx", "ecx", "eax", \ */
|
64 |
|
|
/* OBSOLETE "retaddr", "trapnum", "errcode", "ip", \ */
|
65 |
|
|
/* OBSOLETE "cs", "ps", "sp", "ss", \ */
|
66 |
|
|
/* OBSOLETE "fst0", "fst1", "fst2", "fst3", \ */
|
67 |
|
|
/* OBSOLETE "fst4", "fst5", "fst6", "fst7", \ */
|
68 |
|
|
/* OBSOLETE "fctrl", "fstat", "ftag", "fip", \ */
|
69 |
|
|
/* OBSOLETE "fcs", "fopoff", "fopsel" \ */
|
70 |
|
|
/* OBSOLETE } */
|
71 |
|
|
/* OBSOLETE */
|
72 |
|
|
/* OBSOLETE /* Register numbers of various important registers. */
|
73 |
|
|
/* OBSOLETE Note that some of these values are "real" register numbers, */
|
74 |
|
|
/* OBSOLETE and correspond to the general registers of the machine, */
|
75 |
|
|
/* OBSOLETE and some are "phony" register numbers which are too large */
|
76 |
|
|
/* OBSOLETE to be actual register numbers as far as the user is concerned */
|
77 |
|
|
/* OBSOLETE but do serve to get the desired values when passed to read_register. */ */
|
78 |
|
|
/* OBSOLETE */
|
79 |
|
|
/* OBSOLETE #undef FP_REGNUM */
|
80 |
|
|
/* OBSOLETE #define FP_REGNUM 6 /* (ebp) Contains address of executing stack frame */ */
|
81 |
|
|
/* OBSOLETE #undef SP_REGNUM */
|
82 |
|
|
/* OBSOLETE #define SP_REGNUM 18 /* (usp) Contains address of top of stack */ */
|
83 |
|
|
/* OBSOLETE #undef PS_REGNUM */
|
84 |
|
|
/* OBSOLETE #define PS_REGNUM 17 /* (ps) Contains processor status */ */
|
85 |
|
|
/* OBSOLETE #undef PC_REGNUM */
|
86 |
|
|
/* OBSOLETE #define PC_REGNUM 15 /* (eip) Contains program counter */ */
|
87 |
|
|
/* OBSOLETE #undef FP0_REGNUM */
|
88 |
|
|
/* OBSOLETE #define FP0_REGNUM 20 /* Floating point register 0 */ */
|
89 |
|
|
/* OBSOLETE #undef FPC_REGNUM */
|
90 |
|
|
/* OBSOLETE #define FPC_REGNUM 28 /* 80387 control register */ */
|
91 |
|
|
/* OBSOLETE */
|
92 |
|
|
/* OBSOLETE /* Total amount of space needed to store our copies of the machine's */
|
93 |
|
|
/* OBSOLETE register state, the array `registers'. */ */
|
94 |
|
|
/* OBSOLETE */
|
95 |
|
|
/* OBSOLETE #undef REGISTER_BYTES */
|
96 |
|
|
/* OBSOLETE #define REGISTER_BYTES (20*4+8*10+7*4) */
|
97 |
|
|
/* OBSOLETE */
|
98 |
|
|
/* OBSOLETE /* Index within `registers' of the first byte of the space for */
|
99 |
|
|
/* OBSOLETE register N. */ */
|
100 |
|
|
/* OBSOLETE */
|
101 |
|
|
/* OBSOLETE #undef REGISTER_BYTE */
|
102 |
|
|
/* OBSOLETE #define REGISTER_BYTE(N) \ */
|
103 |
|
|
/* OBSOLETE ((N) >= FPC_REGNUM ? (((N) - FPC_REGNUM) * 4) + 160 \ */
|
104 |
|
|
/* OBSOLETE : (N) >= FP0_REGNUM ? (((N) - FP0_REGNUM) * 10) + 80 \ */
|
105 |
|
|
/* OBSOLETE : (N) * 4) */
|
106 |
|
|
/* OBSOLETE */
|
107 |
|
|
/* OBSOLETE /* Number of bytes of storage in the actual machine representation */
|
108 |
|
|
/* OBSOLETE for register N. */ */
|
109 |
|
|
/* OBSOLETE */
|
110 |
|
|
/* OBSOLETE #undef REGISTER_RAW_SIZE */
|
111 |
|
|
/* OBSOLETE #define REGISTER_RAW_SIZE(N) (((unsigned)((N) - FP0_REGNUM)) < 8 ? 10 : 4) */
|
112 |
|
|
/* OBSOLETE */
|
113 |
|
|
/* OBSOLETE /* Number of bytes of storage in the program's representation */
|
114 |
|
|
/* OBSOLETE for register N. */ */
|
115 |
|
|
/* OBSOLETE */
|
116 |
|
|
/* OBSOLETE #undef REGISTER_VIRTUAL_SIZE */
|
117 |
|
|
/* OBSOLETE #define REGISTER_VIRTUAL_SIZE(N) (((unsigned)((N) - FP0_REGNUM)) < 8 ? 8 : 4) */
|
118 |
|
|
/* OBSOLETE */
|
119 |
|
|
/* OBSOLETE /* Nonzero if register N requires conversion */
|
120 |
|
|
/* OBSOLETE from raw format to virtual format. */ */
|
121 |
|
|
/* OBSOLETE */
|
122 |
|
|
/* OBSOLETE #undef REGISTER_CONVERTIBLE */
|
123 |
|
|
/* OBSOLETE #define REGISTER_CONVERTIBLE(N) (((unsigned)((N) - FP0_REGNUM)) < 8) */
|
124 |
|
|
/* OBSOLETE */
|
125 |
|
|
/* OBSOLETE /* Convert data from raw format for register REGNUM in buffer FROM */
|
126 |
|
|
/* OBSOLETE to virtual format with type TYPE in buffer TO. */ */
|
127 |
|
|
/* OBSOLETE */
|
128 |
|
|
/* OBSOLETE #undef REGISTER_CONVERT_TO_VIRTUAL */
|
129 |
|
|
/* OBSOLETE #define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,TYPE,FROM,TO) \ */
|
130 |
|
|
/* OBSOLETE { \ */
|
131 |
|
|
/* OBSOLETE double val; \ */
|
132 |
|
|
/* OBSOLETE i387_to_double ((FROM), (char *)&val); \ */
|
133 |
|
|
/* OBSOLETE store_floating ((TO), TYPE_LENGTH (TYPE), val); \ */
|
134 |
|
|
/* OBSOLETE } */
|
135 |
|
|
/* OBSOLETE extern void i387_to_double (char *, char *); */
|
136 |
|
|
/* OBSOLETE */
|
137 |
|
|
/* OBSOLETE /* Convert data from virtual format with type TYPE in buffer FROM */
|
138 |
|
|
/* OBSOLETE to raw format for register REGNUM in buffer TO. */ */
|
139 |
|
|
/* OBSOLETE */
|
140 |
|
|
/* OBSOLETE #undef REGISTER_CONVERT_TO_RAW */
|
141 |
|
|
/* OBSOLETE #define REGISTER_CONVERT_TO_RAW(TYPE,REGNUM,FROM,TO) \ */
|
142 |
|
|
/* OBSOLETE { \ */
|
143 |
|
|
/* OBSOLETE double val = extract_floating ((FROM), TYPE_LENGTH (TYPE)); \ */
|
144 |
|
|
/* OBSOLETE double_to_i387((char *)&val, (TO)); \ */
|
145 |
|
|
/* OBSOLETE } */
|
146 |
|
|
/* OBSOLETE extern void double_to_i387 (char *, char *); */
|
147 |
|
|
/* OBSOLETE */
|
148 |
|
|
/* OBSOLETE /* Return the GDB type object for the "standard" data type */
|
149 |
|
|
/* OBSOLETE of data in register N. */ */
|
150 |
|
|
/* OBSOLETE */
|
151 |
|
|
/* OBSOLETE #undef REGISTER_VIRTUAL_TYPE */
|
152 |
|
|
/* OBSOLETE #define REGISTER_VIRTUAL_TYPE(N) \ */
|
153 |
|
|
/* OBSOLETE (((unsigned)((N) - FP0_REGNUM)) < 8 ? builtin_type_double : builtin_type_int) */
|
154 |
|
|
/* OBSOLETE */
|
155 |
|
|
/* OBSOLETE /* Extract from an array REGBUF containing the (raw) register state */
|
156 |
|
|
/* OBSOLETE a function return value of type TYPE, and copy that, in virtual format, */
|
157 |
|
|
/* OBSOLETE into VALBUF. */ */
|
158 |
|
|
/* OBSOLETE */
|
159 |
|
|
/* OBSOLETE #undef EXTRACT_RETURN_VALUE */
|
160 |
|
|
/* OBSOLETE #define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ */
|
161 |
|
|
/* OBSOLETE memcpy (VALBUF, REGBUF + REGISTER_BYTE (TYPE_CODE (TYPE) == TYPE_CODE_FLT ? FP0_REGNUM : 11), TYPE_LENGTH (TYPE)) */
|
162 |
|
|
/* OBSOLETE */
|
163 |
|
|
/* OBSOLETE /* Write into appropriate registers a function return value */
|
164 |
|
|
/* OBSOLETE of type TYPE, given in virtual format. */ */
|
165 |
|
|
/* OBSOLETE */
|
166 |
|
|
/* OBSOLETE #undef STORE_RETURN_VALUE */
|
167 |
|
|
/* OBSOLETE #define STORE_RETURN_VALUE(TYPE,VALBUF) \ */
|
168 |
|
|
/* OBSOLETE write_register_bytes (REGISTER_BYTE (TYPE_CODE (TYPE) == TYPE_CODE_FLT ? FP0_REGNUM : 11), VALBUF, TYPE_LENGTH (TYPE)) */
|
169 |
|
|
/* OBSOLETE */
|
170 |
|
|
/* OBSOLETE /* Describe the pointer in each stack frame to the previous stack frame */
|
171 |
|
|
/* OBSOLETE (its caller). */ */
|
172 |
|
|
/* OBSOLETE */
|
173 |
|
|
/* OBSOLETE /* FRAME_CHAIN takes a frame's nominal address */
|
174 |
|
|
/* OBSOLETE and produces the frame's chain-pointer. */ */
|
175 |
|
|
/* OBSOLETE */
|
176 |
|
|
/* OBSOLETE #undef FRAME_CHAIN */
|
177 |
|
|
/* OBSOLETE #define FRAME_CHAIN(thisframe) \ */
|
178 |
|
|
/* OBSOLETE (!inside_entry_file ((thisframe)->pc) ? \ */
|
179 |
|
|
/* OBSOLETE read_memory_integer ((thisframe)->frame, 4) :\ */
|
180 |
|
|
/* OBSOLETE 0) */
|
181 |
|
|
/* OBSOLETE */
|
182 |
|
|
/* OBSOLETE /* Define other aspects of the stack frame. */ */
|
183 |
|
|
/* OBSOLETE */
|
184 |
|
|
/* OBSOLETE /* A macro that tells us whether the function invocation represented */
|
185 |
|
|
/* OBSOLETE by FI does not have a frame on the stack associated with it. If it */
|
186 |
|
|
/* OBSOLETE does not, FRAMELESS is set to 1, else 0. */ */
|
187 |
|
|
/* OBSOLETE */
|
188 |
|
|
/* OBSOLETE #undef FRAMELESS_FUNCTION_INVOCATION */
|
189 |
|
|
/* OBSOLETE #define FRAMELESS_FUNCTION_INVOCATION(FI) \ */
|
190 |
|
|
/* OBSOLETE (frameless_look_for_prologue (FI)) */
|
191 |
|
|
/* OBSOLETE */
|
192 |
|
|
/* OBSOLETE #undef FRAME_SAVED_PC */
|
193 |
|
|
/* OBSOLETE #define FRAME_SAVED_PC(FRAME) (read_memory_integer ((FRAME)->frame + 4, 4)) */
|
194 |
|
|
/* OBSOLETE */
|
195 |
|
|
/* OBSOLETE /* Insert the specified number of args and function address */
|
196 |
|
|
/* OBSOLETE into a call sequence of the above form stored at DUMMYNAME. */ */
|
197 |
|
|
/* OBSOLETE */
|
198 |
|
|
/* OBSOLETE #undef FIX_CALL_DUMMY */
|
199 |
|
|
/* OBSOLETE #define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \ */
|
200 |
|
|
/* OBSOLETE { \ */
|
201 |
|
|
/* OBSOLETE *(int *)((char *)(dummyname) + 1) = (int)(fun) - (pc) - 5; \ */
|
202 |
|
|
/* OBSOLETE } */
|
203 |
|
|
/* OBSOLETE */
|
204 |
|
|
/* OBSOLETE #endif /* !defined (TM_SUN386_H) */ */
|