OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [gdb-5.0/] [gdb/] [config/] [convex/] [tm-convex.h] - Blame information for rev 106

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 106 markom
/* OBSOLETE /* Definitions to make GDB run on Convex Unix (4bsd) */
2
/* OBSOLETE    Copyright 1989, 1991, 1993 Free Software Foundation, Inc. */
3
/* OBSOLETE  */
4
/* OBSOLETE This file is part of GDB. */
5
/* OBSOLETE  */
6
/* OBSOLETE This program is free software; you can redistribute it and/or modify */
7
/* OBSOLETE it under the terms of the GNU General Public License as published by */
8
/* OBSOLETE the Free Software Foundation; either version 2 of the License, or */
9
/* OBSOLETE (at your option) any later version. */
10
/* OBSOLETE  */
11
/* OBSOLETE This program is distributed in the hope that it will be useful, */
12
/* OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of */
13
/* OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the */
14
/* OBSOLETE GNU General Public License for more details. */
15
/* OBSOLETE  */
16
/* OBSOLETE You should have received a copy of the GNU General Public License */
17
/* OBSOLETE along with this program; if not, write to the Free Software */
18
/* OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  *x/ */
19
/* OBSOLETE  */
20
/* OBSOLETE #define TARGET_BYTE_ORDER BIG_ENDIAN */
21
/* OBSOLETE  */
22
/* OBSOLETE /* There is come problem with the debugging symbols generated by the */
23
/* OBSOLETE    compiler such that the debugging symbol for the first line of a */
24
/* OBSOLETE    function overlap with the function prologue.  *x/ */
25
/* OBSOLETE #define PROLOGUE_FIRSTLINE_OVERLAP */
26
/* OBSOLETE  */
27
/* OBSOLETE /* When convex pcc says CHAR or SHORT, it provides the correct address.  *x/ */
28
/* OBSOLETE  */
29
/* OBSOLETE #define BELIEVE_PCC_PROMOTION 1 */
30
/* OBSOLETE  */
31
/* OBSOLETE /* Symbol types to ignore.  *x/ */
32
/* OBSOLETE /* 0xc4 is N_MONPT.  Use the numeric value for the benefit of people */
33
/* OBSOLETE    with (rather) old OS's.  *x/ */
34
/* OBSOLETE #define IGNORE_SYMBOL(TYPE) \ */
35
/* OBSOLETE     (((TYPE) & ~N_EXT) == N_TBSS       \ */
36
/* OBSOLETE      || ((TYPE) & ~N_EXT) == N_TDATA   \ */
37
/* OBSOLETE      || ((TYPE) & ~N_EXT) == 0xc4) */
38
/* OBSOLETE  */
39
/* OBSOLETE /* Offset from address of function to start of its code. */
40
/* OBSOLETE    Zero on most machines.  *x/ */
41
/* OBSOLETE  */
42
/* OBSOLETE #define FUNCTION_START_OFFSET 0 */
43
/* OBSOLETE  */
44
/* OBSOLETE /* Advance PC across any function entry prologue instructions */
45
/* OBSOLETE    to reach some "real" code. */
46
/* OBSOLETE    Convex prolog is: */
47
/* OBSOLETE        [sub.w #-,sp]                in one of 3 possible sizes */
48
/* OBSOLETE        [mov psw,-           fc/vc main program prolog */
49
/* OBSOLETE         and #-,-              (skip it because the "mov psw" saves the */
50
/* OBSOLETE     mov -,psw]                 T bit, so continue gets a surprise trap) */
51
/* OBSOLETE        [and #-,sp]          fc/vc O2 main program prolog */
52
/* OBSOLETE        [ld.- -(ap),-]               pcc/gcc register arg loads */
53
/* OBSOLETE *x/ */
54
/* OBSOLETE  */
55
/* OBSOLETE extern CORE_ADDR convex_skip_prologue PARAMS ((CORE_ADDR pc)); */
56
/* OBSOLETE #define SKIP_PROLOGUE(pc) (convex_skip_prologue (pc)) */
57
/* OBSOLETE  */
58
/* OBSOLETE /* Immediately after a function call, return the saved pc. */
59
/* OBSOLETE    (ignore frame and return *$sp so we can handle both calls and callq) *x/ */
60
/* OBSOLETE  */
61
/* OBSOLETE #define SAVED_PC_AFTER_CALL(frame) \ */
62
/* OBSOLETE     read_memory_integer (read_register (SP_REGNUM), 4) */
63
/* OBSOLETE  */
64
/* OBSOLETE /* Address of end of stack space. */
65
/* OBSOLETE    This is ((USRSTACK + 0xfff) & -0x1000)) from <convex/vmparam.h> but */
66
/* OBSOLETE    that expression depends on the kernel version; instead, fetch a */
67
/* OBSOLETE    page-zero pointer and get it from that.  This will be invalid if */
68
/* OBSOLETE    they ever change the way bkpt signals are delivered.  *x/ */
69
/* OBSOLETE  */
70
/* OBSOLETE #define STACK_END_ADDR (0xfffff000 & *(unsigned *) 0x80000050) */
71
/* OBSOLETE  */
72
/* OBSOLETE /* User-mode traps push an extended rtn block, */
73
/* OBSOLETE    then fault with one of the following PCs *x/ */
74
/* OBSOLETE  */
75
/* OBSOLETE #define is_trace_pc(pc)  ((unsigned) ((pc) - (*(int *) 0x80000040)) <= 4) */
76
/* OBSOLETE #define is_arith_pc(pc)  ((unsigned) ((pc) - (*(int *) 0x80000044)) <= 4) */
77
/* OBSOLETE #define is_break_pc(pc)  ((unsigned) ((pc) - (*(int *) 0x80000050)) <= 4) */
78
/* OBSOLETE  */
79
/* OBSOLETE /* We need to manipulate trap bits in the psw *x/ */
80
/* OBSOLETE  */
81
/* OBSOLETE #define PSW_TRAP_FLAGS      0x69670000 */
82
/* OBSOLETE #define PSW_T_BIT   0x08000000 */
83
/* OBSOLETE #define PSW_S_BIT   0x01000000 */
84
/* OBSOLETE  */
85
/* OBSOLETE /* Stack grows downward.  *x/ */
86
/* OBSOLETE  */
87
/* OBSOLETE #define INNER_THAN(lhs,rhs) ((lhs) < (rhs)) */
88
/* OBSOLETE  */
89
/* OBSOLETE /* Sequence of bytes for breakpoint instruction. (bkpt)  *x/ */
90
/* OBSOLETE  */
91
/* OBSOLETE #define BREAKPOINT {0x7d,0x50} */
92
/* OBSOLETE  */
93
/* OBSOLETE /* Amount PC must be decremented by after a breakpoint. */
94
/* OBSOLETE    This is often the number of bytes in BREAKPOINT but not always. */
95
/* OBSOLETE    (The break PC needs to be decremented by 2, but we do it when the */
96
/* OBSOLETE    break frame is recognized and popped.  That way gdb can tell breaks */
97
/* OBSOLETE    from trace traps with certainty.) *x/ */
98
/* OBSOLETE  */
99
/* OBSOLETE #define DECR_PC_AFTER_BREAK 0 */
100
/* OBSOLETE  */
101
/* OBSOLETE /* Say how long (ordinary) registers are.  This is a piece of bogosity */
102
/* OBSOLETE    used in push_word and a few other places; REGISTER_RAW_SIZE is the */
103
/* OBSOLETE    real way to know how big a register is.  *x/ */
104
/* OBSOLETE  */
105
/* OBSOLETE #define REGISTER_SIZE 8 */
106
/* OBSOLETE  */
107
/* OBSOLETE /* Number of machine registers *x/ */
108
/* OBSOLETE  */
109
/* OBSOLETE #define NUM_REGS 26 */
110
/* OBSOLETE  */
111
/* OBSOLETE /* Initializer for an array of names of registers. */
112
/* OBSOLETE    There should be NUM_REGS strings in this initializer.  *x/ */
113
/* OBSOLETE  */
114
/* OBSOLETE #define REGISTER_NAMES {"pc","psw","fp","ap","a5","a4","a3","a2","a1","sp",\ */
115
/* OBSOLETE                     "s7","s6","s5","s4","s3","s2","s1","s0",\ */
116
/* OBSOLETE                     "S7","S6","S5","S4","S3","S2","S1","S0"} */
117
/* OBSOLETE  */
118
/* OBSOLETE /* Register numbers of various important registers. */
119
/* OBSOLETE    Note that some of these values are "real" register numbers, */
120
/* OBSOLETE    and correspond to the general registers of the machine, */
121
/* OBSOLETE    and some are "phony" register numbers which are too large */
122
/* OBSOLETE    to be actual register numbers as far as the user is concerned */
123
/* OBSOLETE    but do serve to get the desired values when passed to read_register.  *x/ */
124
/* OBSOLETE  */
125
/* OBSOLETE #define S0_REGNUM 25                /* the real S regs *x/ */
126
/* OBSOLETE #define S7_REGNUM 18 */
127
/* OBSOLETE #define s0_REGNUM 17                /* low-order halves of S regs *x/ */
128
/* OBSOLETE #define s7_REGNUM 10 */
129
/* OBSOLETE #define SP_REGNUM 9                 /* A regs *x/ */
130
/* OBSOLETE #define A1_REGNUM 8 */
131
/* OBSOLETE #define A5_REGNUM 4 */
132
/* OBSOLETE #define AP_REGNUM 3 */
133
/* OBSOLETE #define FP_REGNUM 2         /* Contains address of executing stack frame *x/ */
134
/* OBSOLETE #define PS_REGNUM 1         /* Contains processor status *x/ */
135
/* OBSOLETE #define PC_REGNUM 0         /* Contains program counter *x/ */
136
/* OBSOLETE  */
137
/* OBSOLETE /* convert dbx stab register number (from `r' declaration) to a gdb REGNUM *x/ */
138
/* OBSOLETE  */
139
/* OBSOLETE #define STAB_REG_TO_REGNUM(value) \ */
140
/* OBSOLETE       ((value) < 8 ? S0_REGNUM - (value) : SP_REGNUM - ((value) - 8)) */
141
/* OBSOLETE  */
142
/* OBSOLETE /* Vector register numbers, not handled as ordinary regs. */
143
/* OBSOLETE    They are treated as convenience variables whose values are read */
144
/* OBSOLETE    from the inferior when needed.  *x/ */
145
/* OBSOLETE  */
146
/* OBSOLETE #define V0_REGNUM 0 */
147
/* OBSOLETE #define V7_REGNUM 7 */
148
/* OBSOLETE #define VM_REGNUM 8 */
149
/* OBSOLETE #define VS_REGNUM 9 */
150
/* OBSOLETE #define VL_REGNUM 10 */
151
/* OBSOLETE  */
152
/* OBSOLETE /* Total amount of space needed to store our copies of the machine's */
153
/* OBSOLETE    register state, the array `registers'.  *x/ */
154
/* OBSOLETE #define REGISTER_BYTES (4*10 + 8*8) */
155
/* OBSOLETE  */
156
/* OBSOLETE /* Index within `registers' of the first byte of the space for */
157
/* OBSOLETE    register N. */
158
/* OBSOLETE    NB: must match structure of struct syscall_context for correct operation *x/ */
159
/* OBSOLETE  */
160
/* OBSOLETE #define REGISTER_BYTE(N) ((N) < s7_REGNUM ? 4*(N) : \ */
161
/* OBSOLETE                       (N) < S7_REGNUM ? 44 + 8 * ((N)-s7_REGNUM) : \ */
162
/* OBSOLETE                                         40 + 8 * ((N)-S7_REGNUM)) */
163
/* OBSOLETE  */
164
/* OBSOLETE /* Number of bytes of storage in the actual machine representation */
165
/* OBSOLETE    for register N. *x/ */
166
/* OBSOLETE  */
167
/* OBSOLETE #define REGISTER_RAW_SIZE(N) ((N) < S7_REGNUM ? 4 : 8) */
168
/* OBSOLETE  */
169
/* OBSOLETE /* Number of bytes of storage in the program's representation */
170
/* OBSOLETE    for register N.   *x/ */
171
/* OBSOLETE  */
172
/* OBSOLETE #define REGISTER_VIRTUAL_SIZE(N) REGISTER_RAW_SIZE(N) */
173
/* OBSOLETE  */
174
/* OBSOLETE /* Largest value REGISTER_RAW_SIZE can have.  *x/ */
175
/* OBSOLETE  */
176
/* OBSOLETE #define MAX_REGISTER_RAW_SIZE 8 */
177
/* OBSOLETE  */
178
/* OBSOLETE /* Largest value REGISTER_VIRTUAL_SIZE can have.  *x/ */
179
/* OBSOLETE  */
180
/* OBSOLETE #define MAX_REGISTER_VIRTUAL_SIZE 8 */
181
/* OBSOLETE  */
182
/* OBSOLETE /* Return the GDB type object for the "standard" data type */
183
/* OBSOLETE    of data in register N.  *x/ */
184
/* OBSOLETE  */
185
/* OBSOLETE #define REGISTER_VIRTUAL_TYPE(N) \ */
186
/* OBSOLETE    ((N) < S7_REGNUM ? builtin_type_int : builtin_type_long_long) */
187
/* OBSOLETE  */
188
/* OBSOLETE /* Store the address of the place in which to copy the structure the */
189
/* OBSOLETE    subroutine will return.  This is called from call_function. *x/ */
190
/* OBSOLETE  */
191
/* OBSOLETE #define STORE_STRUCT_RETURN(ADDR, SP) \ */
192
/* OBSOLETE   { write_register (A1_REGNUM, (ADDR)); } */
193
/* OBSOLETE  */
194
/* OBSOLETE /* Extract from an array REGBUF containing the (raw) register state */
195
/* OBSOLETE    a function return value of type TYPE, and copy that, in virtual format, */
196
/* OBSOLETE    into VALBUF.  *x/ */
197
/* OBSOLETE  */
198
/* OBSOLETE #define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ */
199
/* OBSOLETE   memcpy (VALBUF, &((char *) REGBUF) [REGISTER_BYTE (S0_REGNUM) + \ */
200
/* OBSOLETE                          8 - TYPE_LENGTH (TYPE)],\ */
201
/* OBSOLETE      TYPE_LENGTH (TYPE)) */
202
/* OBSOLETE  */
203
/* OBSOLETE /* Write into appropriate registers a function return value */
204
/* OBSOLETE    of type TYPE, given in virtual format.  *x/ */
205
/* OBSOLETE  */
206
/* OBSOLETE #define STORE_RETURN_VALUE(TYPE,VALBUF) \ */
207
/* OBSOLETE     write_register_bytes (REGISTER_BYTE (S0_REGNUM), VALBUF, 8) */
208
/* OBSOLETE  */
209
/* OBSOLETE /* Extract from an array REGBUF containing the (raw) register state */
210
/* OBSOLETE    the address in which a function should return its structure value, */
211
/* OBSOLETE    as a CORE_ADDR (or an expression that can be used as one).  *x/ */
212
/* OBSOLETE  */
213
/* OBSOLETE #define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \ */
214
/* OBSOLETE     (*(int *) & ((char *) REGBUF) [REGISTER_BYTE (s0_REGNUM)]) */
215
/* OBSOLETE  */
216
/* OBSOLETE /* Define trapped internal variable hooks to read and write */
217
/* OBSOLETE    vector and communication registers.  *x/ */
218
/* OBSOLETE  */
219
/* OBSOLETE #define IS_TRAPPED_INTERNALVAR is_trapped_internalvar */
220
/* OBSOLETE #define VALUE_OF_TRAPPED_INTERNALVAR value_of_trapped_internalvar */
221
/* OBSOLETE #define SET_TRAPPED_INTERNALVAR set_trapped_internalvar */
222
/* OBSOLETE  */
223
/* OBSOLETE extern struct value *value_of_trapped_internalvar (); */
224
/* OBSOLETE  */
225
/* OBSOLETE /* Hooks to read data from soff exec and core files, */
226
/* OBSOLETE    and to describe the files.  *x/ */
227
/* OBSOLETE  */
228
/* OBSOLETE #define FILES_INFO_HOOK print_maps */
229
/* OBSOLETE  */
230
/* OBSOLETE /* Hook to call to print a typeless integer value, normally printed in decimal. */
231
/* OBSOLETE    For convex, use hex instead if the number looks like an address.  *x/ */
232
/* OBSOLETE  */
233
/* OBSOLETE #define PRINT_TYPELESS_INTEGER decout */
234
/* OBSOLETE  */
235
/* OBSOLETE /* For the native compiler, variables for a particular lexical context */
236
/* OBSOLETE    are listed after the beginning LBRAC instead of before in the */
237
/* OBSOLETE    executables list of symbols.  Using "gcc_compiled." to distinguish */
238
/* OBSOLETE    between GCC and native compiler doesn't work on Convex because the */
239
/* OBSOLETE    linker sorts the symbols to put "gcc_compiled." in the wrong place. */
240
/* OBSOLETE    desc is nonzero for native, zero for gcc.   *x/ */
241
/* OBSOLETE #define VARIABLES_INSIDE_BLOCK(desc, gcc_p) (desc != 0) */
242
/* OBSOLETE  */
243
/* OBSOLETE /* Pcc occaisionally puts an SO where there should be an SOL.   *x/ */
244
/* OBSOLETE #define PCC_SOL_BROKEN */
245
/* OBSOLETE  */
246
/* OBSOLETE /* Describe the pointer in each stack frame to the previous stack frame */
247
/* OBSOLETE    (its caller).  *x/ */
248
/* OBSOLETE  */
249
/* OBSOLETE /* FRAME_CHAIN takes a frame_info with a frame's nominal address in fi->frame, */
250
/* OBSOLETE    and produces the frame's chain-pointer. *x/ */
251
/* OBSOLETE  */
252
/* OBSOLETE /* (caller fp is saved at 8(fp)) *x/ */
253
/* OBSOLETE  */
254
/* OBSOLETE #define FRAME_CHAIN(fi)   (read_memory_integer ((fi)->frame + 8, 4)) */
255
/* OBSOLETE  */
256
/* OBSOLETE /* Define other aspects of the stack frame.  *x/ */
257
/* OBSOLETE  */
258
/* OBSOLETE /* We need the boundaries of the text in the exec file, as a kludge, */
259
/* OBSOLETE    for FRAMELESS_FUNCTION_INVOCATION and CALL_DUMMY_LOCATION. *x/ */
260
/* OBSOLETE  */
261
/* OBSOLETE #define     NEED_TEXT_START_END 1 */
262
/* OBSOLETE  */
263
/* OBSOLETE /* An expression that tells us whether the function invocation represented */
264
/* OBSOLETE    by FI does not have a frame on the stack associated with it. */
265
/* OBSOLETE    On convex, check at the return address for `callq' -- if so, frameless, */
266
/* OBSOLETE    otherwise, not.  *x/ */
267
/* OBSOLETE  */
268
/* OBSOLETE extern int convex_frameless_function_invocation PARAMS ((struct frame_info *fi)); */
269
/* OBSOLETE #define FRAMELESS_FUNCTION_INVOCATION(FI) (convex_frameless_function_invocatio (FI)) */
270
/* OBSOLETE  */
271
/* OBSOLETE #define FRAME_SAVED_PC(fi) (read_memory_integer ((fi)->frame, 4)) */
272
/* OBSOLETE  */
273
/* OBSOLETE #define FRAME_ARGS_ADDRESS(fi) (read_memory_integer ((fi)->frame + 12, 4)) */
274
/* OBSOLETE  */
275
/* OBSOLETE #define FRAME_LOCALS_ADDRESS(fi) (fi)->frame */
276
/* OBSOLETE  */
277
/* OBSOLETE /* Return number of args passed to a frame. */
278
/* OBSOLETE    Can return -1, meaning no way to tell.  *x/ */
279
/* OBSOLETE  */
280
/* OBSOLETE extern int convex_frame_num_args PARAMS ((struct frame_info *fi)); */
281
/* OBSOLETE #define FRAME_NUM_ARGS(fi) (convex_frame_num_args ((fi))) */
282
/* OBSOLETE  */
283
/* OBSOLETE /* Return number of bytes at start of arglist that are not really args.  *x/ */
284
/* OBSOLETE  */
285
/* OBSOLETE #define FRAME_ARGS_SKIP 0 */
286
/* OBSOLETE  */
287
/* OBSOLETE /* Put here the code to store, into a struct frame_saved_regs, */
288
/* OBSOLETE    the addresses of the saved registers of frame described by FRAME_INFO. */
289
/* OBSOLETE    This includes special registers such as pc and fp saved in special */
290
/* OBSOLETE    ways in the stack frame.  sp is even more special: */
291
/* OBSOLETE    the address we return for it IS the sp for the next frame.  *x/ */
292
/* OBSOLETE  */
293
/* OBSOLETE /* Normal (short) frames save only PC, FP, (callee's) AP.  To reasonably */
294
/* OBSOLETE    handle gcc and pcc register variables, scan the code following the */
295
/* OBSOLETE    call for the instructions the compiler inserts to reload register */
296
/* OBSOLETE    variables from stack slots and record the stack slots as the saved */
297
/* OBSOLETE    locations of those registers.  This will occasionally identify some */
298
/* OBSOLETE    random load as a saved register; this is harmless.  vc does not */
299
/* OBSOLETE    declare its register allocation actions in the stabs.  *x/ */
300
/* OBSOLETE  */
301
/* OBSOLETE #define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs)         \ */
302
/* OBSOLETE { register int regnum;                                                      \ */
303
/* OBSOLETE   register int frame_length =       /* 3 short, 2 long, 1 extended, 0 context *x/\ */
304
/* OBSOLETE       (read_memory_integer ((frame_info)->frame + 4, 4) >> 25) & 3; \ */
305
/* OBSOLETE   register CORE_ADDR frame_fp =                                             \ */
306
/* OBSOLETE       read_memory_integer ((frame_info)->frame + 8, 4);                     \ */
307
/* OBSOLETE   register CORE_ADDR next_addr;                                             \ */
308
/* OBSOLETE   memset (&frame_saved_regs, '\0', sizeof frame_saved_regs);                        \ */
309
/* OBSOLETE   (frame_saved_regs).regs[PC_REGNUM] = (frame_info)->frame + 0;             \ */
310
/* OBSOLETE   (frame_saved_regs).regs[PS_REGNUM] = (frame_info)->frame + 4;             \ */
311
/* OBSOLETE   (frame_saved_regs).regs[FP_REGNUM] = (frame_info)->frame + 8;             \ */
312
/* OBSOLETE   (frame_saved_regs).regs[AP_REGNUM] = frame_fp + 12;                       \ */
313
/* OBSOLETE   next_addr = (frame_info)->frame + 12;                                     \ */
314
/* OBSOLETE   if (frame_length < 3)                                                     \ */
315
/* OBSOLETE     for (regnum = A5_REGNUM; regnum < SP_REGNUM; ++regnum)          \ */
316
/* OBSOLETE       (frame_saved_regs).regs[regnum] = (next_addr += 4);           \ */
317
/* OBSOLETE   if (frame_length < 2)                                                     \ */
318
/* OBSOLETE     (frame_saved_regs).regs[SP_REGNUM] = (next_addr += 4);          \ */
319
/* OBSOLETE   next_addr -= 4;                                                   \ */
320
/* OBSOLETE   if (frame_length < 3)                                                     \ */
321
/* OBSOLETE     for (regnum = S7_REGNUM; regnum < S0_REGNUM; ++regnum)          \ */
322
/* OBSOLETE       (frame_saved_regs).regs[regnum] = (next_addr += 8);           \ */
323
/* OBSOLETE   if (frame_length < 2)                                                     \ */
324
/* OBSOLETE     (frame_saved_regs).regs[S0_REGNUM] = (next_addr += 8);          \ */
325
/* OBSOLETE   else                                                                      \ */
326
/* OBSOLETE     (frame_saved_regs).regs[SP_REGNUM] = next_addr + 8;                     \ */
327
/* OBSOLETE   if (frame_length == 3) {                                          \ */
328
/* OBSOLETE     CORE_ADDR pc = read_memory_integer ((frame_info)->frame, 4);    \ */
329
/* OBSOLETE     int op, ix, disp;                                                       \ */
330
/* OBSOLETE     op = read_memory_integer (pc, 2);                                       \ */
331
/* OBSOLETE     if ((op & 0xffc7) == 0x1480) pc += 4;   /* add.w #-,sp *x/      \ */
332
/* OBSOLETE     else if ((op & 0xffc7) == 0x58c0) pc += 2;      /* add.w #-,sp *x/      \ */
333
/* OBSOLETE     op = read_memory_integer (pc, 2);                                       \ */
334
/* OBSOLETE     if ((op & 0xffc7) == 0x2a06) pc += 4;   /* ld.w -,ap *x/                \ */
335
/* OBSOLETE     for (;;) {                                                              \ */
336
/* OBSOLETE       op = read_memory_integer (pc, 2);                                     \ */
337
/* OBSOLETE       ix = (op >> 3) & 7;                                           \ */
338
/* OBSOLETE       if ((op & 0xfcc0) == 0x2800) {                /* ld.- -,ak *x/                \ */
339
/* OBSOLETE         regnum = SP_REGNUM - (op & 7);                                      \ */
340
/* OBSOLETE     disp = read_memory_integer (pc + 2, 2);                         \ */
341
/* OBSOLETE     pc += 4;}                                                       \ */
342
/* OBSOLETE       else if ((op & 0xfcc0) == 0x2840) {   /* ld.- -,ak *x/                \ */
343
/* OBSOLETE         regnum = SP_REGNUM - (op & 7);                                      \ */
344
/* OBSOLETE     disp = read_memory_integer (pc + 2, 4);                         \ */
345
/* OBSOLETE     pc += 6;}                                                       \ */
346
/* OBSOLETE       if ((op & 0xfcc0) == 0x3000) {                /* ld.- -,sk *x/                \ */
347
/* OBSOLETE         regnum = S0_REGNUM - (op & 7);                                      \ */
348
/* OBSOLETE     disp = read_memory_integer (pc + 2, 2);                         \ */
349
/* OBSOLETE     pc += 4;}                                                       \ */
350
/* OBSOLETE       else if ((op & 0xfcc0) == 0x3040) {   /* ld.- -,sk *x/                \ */
351
/* OBSOLETE         regnum = S0_REGNUM - (op & 7);                                      \ */
352
/* OBSOLETE     disp = read_memory_integer (pc + 2, 4);                         \ */
353
/* OBSOLETE     pc += 6;}                                                       \ */
354
/* OBSOLETE       else if ((op & 0xff00) == 0x7100) {   /* br crossjump *x/     \ */
355
/* OBSOLETE         pc += 2 * (char) op;                                                \ */
356
/* OBSOLETE         continue;}                                                  \ */
357
/* OBSOLETE       else if (op == 0x0140) {                      /* jmp crossjump *x/    \ */
358
/* OBSOLETE         pc = read_memory_integer (pc + 2, 4);                               \ */
359
/* OBSOLETE         continue;}                                                  \ */
360
/* OBSOLETE       else break;                                                   \ */
361
/* OBSOLETE       if ((frame_saved_regs).regs[regnum])                          \ */
362
/* OBSOLETE     break;                                                          \ */
363
/* OBSOLETE       if (ix == 7) disp += frame_fp;                                        \ */
364
/* OBSOLETE       else if (ix == 6) disp += read_memory_integer (frame_fp + 12, 4);     \ */
365
/* OBSOLETE       else if (ix != 0) break;                                              \ */
366
/* OBSOLETE       (frame_saved_regs).regs[regnum] =                                     \ */
367
/* OBSOLETE     disp - 8 + (1 << ((op >> 8) & 3));                              \ */
368
/* OBSOLETE       if (regnum >= S7_REGNUM)                                              \ */
369
/* OBSOLETE         (frame_saved_regs).regs[regnum - S0_REGNUM + s0_REGNUM] =   \ */
370
/* OBSOLETE       disp - 4 + (1 << ((op >> 8) & 3));                            \ */
371
/* OBSOLETE     }                                                                       \ */
372
/* OBSOLETE   }                                                                 \ */
373
/* OBSOLETE } */
374
/* OBSOLETE  */
375
/* OBSOLETE /* Things needed for making the inferior call functions.  *x/ */
376
/* OBSOLETE  */
377
/* OBSOLETE #define     CALL_DUMMY_LOCATION     BEFORE_TEXT_END */
378
/* OBSOLETE  */
379
/* OBSOLETE /* Push an empty stack frame, to record the current PC, etc.  *x/ */
380
/* OBSOLETE  */
381
/* OBSOLETE #define PUSH_DUMMY_FRAME \ */
382
/* OBSOLETE { register CORE_ADDR sp = read_register (SP_REGNUM);                        \ */
383
/* OBSOLETE   register int regnum;                                                      \ */
384
/* OBSOLETE   char buf[8];                                                              \ */
385
/* OBSOLETE   long word;                                                                \ */
386
/* OBSOLETE   for (regnum = S0_REGNUM; regnum >= S7_REGNUM; --regnum) {                 \ */
387
/* OBSOLETE     read_register_bytes (REGISTER_BYTE (regnum), buf, 8);           \ */
388
/* OBSOLETE     sp = push_bytes (sp, buf, 8);}                                  \ */
389
/* OBSOLETE   for (regnum = SP_REGNUM; regnum >= FP_REGNUM; --regnum) {                 \ */
390
/* OBSOLETE     word = read_register (regnum);                                  \ */
391
/* OBSOLETE     sp = push_bytes (sp, &word, 4);}                                        \ */
392
/* OBSOLETE   word = (read_register (PS_REGNUM) &~ (3<<25)) | (1<<25);          \ */
393
/* OBSOLETE   sp = push_bytes (sp, &word, 4);                                   \ */
394
/* OBSOLETE   word = read_register (PC_REGNUM);                                 \ */
395
/* OBSOLETE   sp = push_bytes (sp, &word, 4);                                           \ */
396
/* OBSOLETE   write_register (SP_REGNUM, sp);                                   \ */
397
/* OBSOLETE   write_register (FP_REGNUM, sp);                                   \ */
398
/* OBSOLETE   write_register (AP_REGNUM, sp);} */
399
/* OBSOLETE  */
400
/* OBSOLETE /* Discard from the stack the innermost frame, restoring all registers.  *x/ */
401
/* OBSOLETE  */
402
/* OBSOLETE #define POP_FRAME  do {\ */
403
/* OBSOLETE   register CORE_ADDR fp = read_register (FP_REGNUM);            \ */
404
/* OBSOLETE   register int regnum;                                          \ */
405
/* OBSOLETE   register int frame_length =       /* 3 short, 2 long, 1 extended, 0 context *x/ \ */
406
/* OBSOLETE       (read_memory_integer (fp + 4, 4) >> 25) & 3;          \ */
407
/* OBSOLETE   char buf[8];                                                  \ */
408
/* OBSOLETE   write_register (PC_REGNUM, read_memory_integer (fp, 4));  \ */
409
/* OBSOLETE   write_register (PS_REGNUM, read_memory_integer (fp += 4, 4));  \ */
410
/* OBSOLETE   write_register (FP_REGNUM, read_memory_integer (fp += 4, 4));  \ */
411
/* OBSOLETE   write_register (AP_REGNUM, read_memory_integer (fp += 4, 4));  \ */
412
/* OBSOLETE   if (frame_length < 3)                                  \ */
413
/* OBSOLETE     for (regnum = A5_REGNUM; regnum < SP_REGNUM; ++regnum)   \ */
414
/* OBSOLETE       write_register (regnum, read_memory_integer (fp += 4, 4)); \ */
415
/* OBSOLETE   if (frame_length < 2)                                          \ */
416
/* OBSOLETE     write_register (SP_REGNUM, read_memory_integer (fp += 4, 4)); \ */
417
/* OBSOLETE   fp -= 4;                                                  \ */
418
/* OBSOLETE   if (frame_length < 3)                                     \ */
419
/* OBSOLETE     for (regnum = S7_REGNUM; regnum < S0_REGNUM; ++regnum) {        \ */
420
/* OBSOLETE       read_memory (fp += 8, buf, 8);                                \ */
421
/* OBSOLETE       write_register_bytes (REGISTER_BYTE (regnum), buf, 8);}   \ */
422
/* OBSOLETE   if (frame_length < 2)     {                                       \ */
423
/* OBSOLETE     read_memory (fp += 8, buf, 8);                          \ */
424
/* OBSOLETE     write_register_bytes (REGISTER_BYTE (regnum), buf, 8);}     \ */
425
/* OBSOLETE   else write_register (SP_REGNUM, fp + 8);                  \ */
426
/* OBSOLETE   flush_cached_frames ();                                   \ */
427
/* OBSOLETE } while (0) */
428
/* OBSOLETE  */
429
/* OBSOLETE /* This sequence of words is the instructions */
430
/* OBSOLETE      mov sp,ap */
431
/* OBSOLETE      pshea 69696969 */
432
/* OBSOLETE      calls 32323232 */
433
/* OBSOLETE      bkpt */
434
/* OBSOLETE    Note this is 16 bytes.  *x/ */
435
/* OBSOLETE  */
436
/* OBSOLETE #define CALL_DUMMY {0x50860d4069696969LL,0x2140323232327d50LL} */
437
/* OBSOLETE  */
438
/* OBSOLETE #define CALL_DUMMY_LENGTH 16 */
439
/* OBSOLETE  */
440
/* OBSOLETE #define CALL_DUMMY_START_OFFSET 0 */
441
/* OBSOLETE  */
442
/* OBSOLETE /* Insert the specified number of args and function address */
443
/* OBSOLETE    into a call sequence of the above form stored at DUMMYNAME.  *x/ */
444
/* OBSOLETE  */
445
/* OBSOLETE #define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p)   \ */
446
/* OBSOLETE { *(int *)((char *) dummyname + 4) = nargs; \ */
447
/* OBSOLETE   *(int *)((char *) dummyname + 10) = fun; } */
448
/* OBSOLETE  */
449
/* OBSOLETE /* Defs to read soff symbol tables, see dbxread.c *x/ */
450
/* OBSOLETE  */
451
/* OBSOLETE #define NUMBER_OF_SYMBOLS    ((long) opthdr.o_nsyms) */
452
/* OBSOLETE #define STRING_TABLE_OFFSET  ((long) filehdr.h_strptr) */
453
/* OBSOLETE #define SYMBOL_TABLE_OFFSET  ((long) opthdr.o_symptr) */
454
/* OBSOLETE #define STRING_TABLE_SIZE    ((long) filehdr.h_strsiz) */
455
/* OBSOLETE #define SIZE_OF_TEXT_SEGMENT ((long) txthdr.s_size) */
456
/* OBSOLETE #define ENTRY_POINT          ((long) opthdr.o_entry) */
457
/* OBSOLETE  */
458
/* OBSOLETE #define READ_STRING_TABLE_SIZE(BUFFER) \ */
459
/* OBSOLETE     (BUFFER = STRING_TABLE_SIZE) */
460
/* OBSOLETE  */
461
/* OBSOLETE #define DECLARE_FILE_HEADERS \ */
462
/* OBSOLETE   FILEHDR filehdr;                                                  \ */
463
/* OBSOLETE   OPTHDR opthdr;                                                    \ */
464
/* OBSOLETE   SCNHDR txthdr */
465
/* OBSOLETE  */
466
/* OBSOLETE #define READ_FILE_HEADERS(DESC,NAME) \ */
467
/* OBSOLETE {                                                                   \ */
468
/* OBSOLETE   int n;                                                            \ */
469
/* OBSOLETE   val = myread (DESC, &filehdr, sizeof filehdr);                    \ */
470
/* OBSOLETE   if (val < 0)                                                              \ */
471
/* OBSOLETE     perror_with_name (NAME);                                                \ */
472
/* OBSOLETE   if (! IS_SOFF_MAGIC (filehdr.h_magic))                            \ */
473
/* OBSOLETE     error ("%s: not an executable file.", NAME);                    \ */
474
/* OBSOLETE   lseek (DESC, 0L, 0);                                                      \ */
475
/* OBSOLETE   if (myread (DESC, &filehdr, sizeof filehdr) < 0)                  \ */
476
/* OBSOLETE     perror_with_name (NAME);                                                \ */
477
/* OBSOLETE   if (myread (DESC, &opthdr, filehdr.h_opthdr) <= 0)                        \ */
478
/* OBSOLETE     perror_with_name (NAME);                                                \ */
479
/* OBSOLETE   for (n = 0; n < filehdr.h_nscns; n++)                                     \ */
480
/* OBSOLETE     {                                                                       \ */
481
/* OBSOLETE       if (myread (DESC, &txthdr, sizeof txthdr) < 0)                        \ */
482
/* OBSOLETE     perror_with_name (NAME);                                        \ */
483
/* OBSOLETE       if ((txthdr.s_flags & S_TYPMASK) == S_TEXT)                   \ */
484
/* OBSOLETE     break;                                                          \ */
485
/* OBSOLETE     }                                                                       \ */
486
/* OBSOLETE } */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.